A CLI tool for moving newly created files (like those in download directories) to the current directory or specified destinations.
- Rust 1.70+ (for edition 2024 support)
cargo build --releaseThe compiled binary will be located at target/release/m
Run in any directory:
./mThe program will:
- Read configuration from
~/.config/m/m.json - Scan configured directories for recently created files
- If files are found, display an interactive list for selection
- Ask if you want to rename the file (press Enter to keep current name)
- Move the selected file to the current directory
You can specify a destination shortcut from your configuration:
./m docs
./m pics
./m videosThis will move the selected file to the corresponding destination directory configured in destination.
? Select a file to move:
> 14:43 12KB document.docx
14:41 3MB hello.png
[Use arrow keys to navigate, press Enter to select]
After selecting a file:
? Rename file (press Enter to keep current name): document.docx
- Press Enter to keep the original name
- Or type a new name to rename the file
Finally:
Successfully moved 'document.docx' to /home/user/Documents/
The configuration file is located at ~/.config/m/m.json and contains:
source_dir: Array of directory paths to monitor for recently created filestime_limit: File creation time limit in minutesdestination: (Optional) Map of destination shortcuts to directory paths
A default configuration file will be created on first run:
{
"source_dir": [
"/home/user/Downloads/"
],
"time_limit": 20,
"destination": {}
}{
"source_dir": [
"/home/user/Downloads/",
"/home/user/Desktop/",
"/tmp/"
],
"time_limit": 30,
"destination": {
"docs": "/home/user/Documents/",
"pics": "/home/user/Pictures/",
"videos": "/home/user/Videos/",
"projects": "/home/user/Projects/"
}
}The destination field allows you to define shortcuts for frequently used directories. When you run ./m <shortcut>, the selected file will be moved to the corresponding directory instead of the current directory.
For example, with the configuration above:
./m docsmoves files to/home/user/Documents/./m picsmoves files to/home/user/Pictures/./m videosmoves files to/home/user/Videos/