Forrest logo
tool overview
On this page you find all important commands for the CLI tool rename. If the command you are looking for is missing please ask our AI.

rename

Rename is a command line tool used for renaming multiple files or directories in a batch process. It allows users to efficiently and quickly rename files by specifying patterns, replacement strings, and wildcards.

  1. The rename command is typically used on Unix-like operating systems, such as Linux and macOS.

  2. It can be used to rename files in a specific directory or recursively rename files in subdirectories.

  3. Rename supports regular expressions, which provide powerful and flexible pattern matching capabilities.

  4. It allows users to preview the changes before actually renaming the files, ensuring that they are making the desired modifications.

  5. Users can specify the pattern to match in the original file names and specify the replacement pattern for the new names.

  6. Wildcards, such as "*", can be used to represent any character or set of characters in a file name.

  7. Multiple files can be renamed simultaneously using rename, making it a powerful tool for bulk renaming operations.

  8. It provides various options that allow users to customize the renaming process, such as case sensitivity and conflict resolution strategies.

  9. Rename also supports the use of variables and special characters in the replacement pattern, making it flexible for complex renaming tasks.

  10. The rename command is often used by system administrators and power users who need to efficiently manage and organize large amounts of files and directories.

List of commands for rename:

  • file-rename:tldr:3a875 file-rename: Force renaming even if the operation would remove existing destination files.
    $ rename -f ${'s-foo-bar-'} ${*}
    try on your machine
    explain this command
  • file-rename:tldr:47052 file-rename: Convert filenames to lower case (use `-f` in case-insensitive filesystems to prevent "already exists" errors).
    $ rename 'y/A-Z/a-z/' ${*}
    try on your machine
    explain this command
  • file-rename:tldr:53aff file-rename: Replace whitespace with underscores.
    $ rename 's/\s+/_/g' ${*}
    try on your machine
    explain this command
  • file-rename:tldr:d24f1 file-rename: display which renames would occur without performing them.
    $ rename -n ${'s-foo-bar-'} ${*}
    try on your machine
    explain this command
  • ftp:tldr:f80b2 ftp: Rename a file on the remote server.
    $ rename ${original_filename} ${new_filename}
    try on your machine
    explain this command
  • rename:tldr:2093a rename: Rename a group of increasingly numbered files zero-padding the numbers up to 3 digits.
    $ rename ${foo} ${foo00} ${foo?} && rename ${foo} ${foo0} ${foo??}
    try on your machine
    explain this command
  • rename:tldr:423ef rename: Change file extensions.
    $ rename ${-ext} ${-bak} ${*-ext}
    try on your machine
    explain this command
  • rename:tldr:54bba rename: Do not overwrite existing files.
    $ rename -o ${foo} ${bar} ${*}
    try on your machine
    explain this command
  • rename:tldr:5fd5b rename: display which renames would occur without performing them.
    $ rename -vn ${foo} ${bar} ${*}
    try on your machine
    explain this command
  • rename:tldr:df7c0 rename: Replace `from` with `to` in the filenames of the specified files.
    $ rename 's/${from}/${to}/' ${*-txt}
    try on your machine
    explain this command
tool overview