-
-
Notifications
You must be signed in to change notification settings - Fork 39
Command line options
Ayooluwa edited this page Aug 4, 2021
·
9 revisions
This is the output of f2 --help
:
DESCRIPTION:
F2 is a command-line tool for batch renaming multiple files and directories quickly and safely
USAGE:
f2 FLAGS [OPTIONS] [PATHS...]
AUTHOR:
Ayooluwa Isaiah <ayo@freshman.tech>
VERSION:
v1.6.7
FLAGS:
-f, --find <pattern>
Search pattern. Treated as a regular expression by default unless --string-mode is also used. If omitted, it defaults to the entire file name (including the extension).
-r, --replace <string>
Replacement string. If omitted, defaults to an empty string. Supports built-in and regex capture variables. Learn more about variable support here: https://github.com/ayoisaiah/f2/wiki/Built-in-variables
-u, --undo
Undo the last operation performed in the current working directory if possible. Learn more: https://github.com/ayoisaiah/f2/wiki/Undoing-a-renaming-operation
OPTIONS:
--csv <csv file>
Load a CSV file, and rename according to its contents. File names will be matched according to the content in the first column
-l, --replace-limit <integer>
Limit the number of replacements to be made on the file name (replaces all matches if set to 0). Can be set to a negative integer to start replacing from the end of the file name.
-s, --string-mode
Opt into string literal mode. The presence of this flag causes the search pattern to be treated as a non-regex string.
-E, --exclude <pattern>
Exclude files/directories that match the given search pattern. Treated as a regular expression. Multiple exclude patterns can be specified.
-x, --exec
Execute the batch renaming operation. This will commit the changes to your filesystem.
-R, --recursive
Recursively traverse all directories when searching for matches. Use the --max-depth flag to control the maximum allowed depth (no limit by default).
-m, --max-depth <integer>
Positive integer indicating the maximum depth for a recursive search (set to 0 for no limit).
--sort <sort>
Sort the matches according to the provided '<sort>'.
Allowed sort values:
'default': alphabetical order
'size': file size
'mtime': file last modified time
'btime': file creation time (Windows and macOS only)
'atime': file last access time
'ctime': file metadata last change time
--sortr <sort>
Same as --sort but presents the matches in the reverse order.
-i, --ignore-case
When this flag is provided, the given pattern will be searched case insensitively.
-q, --quiet
Activate silent mode which doesn't print out any information including errors
-e, --ignore-ext
Ignore the file extension when searching for matches.
-d, --include-dir
Include directories when searching for matches as they are exempted by default.
-D, --only-dir
Rename only directories, not files (implies --include-dir)
-H, --hidden
Include hidden directories and files in the matches (they are skipped by default). A hidden file or directory is one whose name starts with a period (all operating systems) or one whose hidden attribute is set to true (Windows only)
-V, --verbose
Enable verbose output. Each renaming operation will be printed out if this flag is provided.
--no-color
Disable coloured output
-F, --fix-conflicts
Automatically fix conflicts based on predefined rules. Learn more: https://github.com/ayoisaiah/f2/wiki/Validation-and-conflict-detection
--allow-overwrites
Allow the overwriting of existing files
-h, --help
show help
-v, --version
print the version
DOCUMENTATION:
https://github.com/ayoisaiah/f2/wiki
WEBSITE:
https://github.com/ayoisaiah/f2