FileGrouper is a powerful Bash script for organizing and managing files within a directory. It provides various options to group, search, and filter files based on their type, size, or name.
- Group files by type, size, or name
- Display all files in a directory
- Search for files matching a specific pattern
- Get files of a specific size or type
To install FileGrouper, follow these steps:
- Clone the repository:
git clone https://github.com/redaezziani/FileChief.git
- Change into the
script
directory:
cd FileChief/script
To use FileGrouper, follow these steps:
- Make the script executable:
chmod +x fileGrouper.sh
- Run the script with the desired options:
./fileGrouper.sh [options]
Available options:
-d <directory>
: Specify the directory to operate on (required)-t
: Group files by type-s
: Group files by size-n
: Group files by name-a
: Display all files in the directory-f <pattern>
: Search for files matching the given pattern-z <size>
: Get files of the specified size-y <type>
: Get files of the specified type
Example usage:
./fileGrouper.sh -d /path/to/directory -t -s
This command will group files in /path/to/directory
by both type and size.
- Group files by type:
./fileGrouper.sh -d /path/to/directory -t
- Search for files with a
.txt
extension:
./fileGrouper.sh -d /path/to/directory -f "*.txt"
- Get files larger than 10MB:
./fileGrouper.sh -d /path/to/directory -z +10M
- Display all regular files in a directory:
./fileGrouper.sh -d /path/to/directory -y f
Please be careful when using the grouping options (-t
, -s
, -n
) as they will move files into new directories. It's recommended to test the script on a small sample directory first to ensure the desired behavior.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
FileGrouper was created by reda ezziani . You can find more of my projects on GitHub.