Skip to content

Command line options

Ayooluwa edited this page May 8, 2021 · 8 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 <[email protected]>

VERSION:
   v1.6.1

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:/ayoisaiah/f2/wiki/Built-in-variables
     
     -u, --undo 
         Undo the last operation performed in the current working directory if possible. Learn more: https:/ayoisaiah/f2/wiki/Undoing-a-renaming-operation
     
OPTIONS:
     -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)
     
     -F, --fix-conflicts 
         Automatically fix conflicts based on predefined rules. Learn more: https:/ayoisaiah/f2/wiki/Validation-and-conflict-detection
     
     -h, --help 
         show help
     
     -v, --version 
         print the version
     
DOCUMENTATION:
  https:/ayoisaiah/f2/wiki

WEBSITE:
  https:/ayoisaiah/f2

Clone this wiki locally