This project is a Rust application that categorizes files in a directory based on their file types. It creates a new directory for each category and moves the files into their respective directories.
file1.txt
file2.jpg
file3.pdf
file4.txt
file5.jpg
- images/
-- file2.jpg
-- file5.jpg
- documents/
-- file1.txt
-- file3.pdf
-- file4.txt
cargo run /path/to/directory
By default it will only move the files in the root directory, if you want to move also the files in subdirectories pass the -r
flag
cargo run /path/to/directory -r
-
Download the latest release
-
Move the executable to /usr/local/bin (or any other directory in your PATH) so you can run it from anywhere.
sudo mv target/release/file_organizer /usr/local/bin
- Add it to your zshrc (or bash) file
Open your ~/.zshrc file in a text editor and add an alias to run your program. Replace my_project with the name of your executable:
echo 'alias my_project="/usr/local/bin/my_project"' >> ~/.zshrc
- Source your zshrc file: To make the changes take effect, you need to source your ~/.zshrc file:
source ~/.zshrc
Contributions are welcome. Please feel free to fork the project and submit a pull request with your changes.
This project is licensed under the MIT License.