Filerename is a command-line tool written in Go that renames files in a directory based on specified criteria. It provides options for filtering files by pattern, converting case, adding timestamps, and handling conflicts.
Build the filerename executable:
go buildRun the executable with the desired options:
filerename -p "*.txt" -c -t -f| Short Flag | Long Flag | Description |
|---|---|---|
| -c | --caps | Capitalize the filename. |
| -l | --lower | Convert the filename to lowercase. |
| -s | --sep | Separator to use when renaming files (default: _). |
| -p | --pattern | Pattern to match files (default: *). |
| -r | --rec | Rename files in subdirectories recursively. |
| -f | --force | Force rename without prompting, overwriting existing files if necessary. |
| -t | --timestamp | Append a timestamp to the filename. |
| -i | --interactive | Interactive mode, prompting for the new name of each file. |
| -v | --version | Print the version and license information. |
Rename all .txt files to uppercase and add a timestamp:
filerename -p "*.txt" -c -tRename all files in the current directory and its subdirectories to lowercase:
filerename -l -rinteractively rename all files in the current directory:
filerename -iThis project is licensed under the 3-Clause BSD License - see the LICENSE.md file for details.