![Forrest logo](/images/logo.png)
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.
-
The rename command is typically used on Unix-like operating systems, such as Linux and macOS.
-
It can be used to rename files in a specific directory or recursively rename files in subdirectories.
-
Rename supports regular expressions, which provide powerful and flexible pattern matching capabilities.
-
It allows users to preview the changes before actually renaming the files, ensuring that they are making the desired modifications.
-
Users can specify the pattern to match in the original file names and specify the replacement pattern for the new names.
-
Wildcards, such as "*", can be used to represent any character or set of characters in a file name.
-
Multiple files can be renamed simultaneously using rename, making it a powerful tool for bulk renaming operations.
-
It provides various options that allow users to customize the renaming process, such as case sensitivity and conflict resolution strategies.
-
Rename also supports the use of variables and special characters in the replacement pattern, making it flexible for complex renaming tasks.
-
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 machineexplain 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 machineexplain this command
-
file-rename:tldr:53aff file-rename: Replace whitespace with underscores.$ rename 's/\s+/_/g' ${*}try on your machineexplain this command
-
file-rename:tldr:d24f1 file-rename: display which renames would occur without performing them.$ rename -n ${'s-foo-bar-'} ${*}try on your machineexplain this command
-
ftp:tldr:f80b2 ftp: Rename a file on the remote server.$ rename ${original_filename} ${new_filename}try on your machineexplain 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 machineexplain this command
-
rename:tldr:423ef rename: Change file extensions.$ rename ${-ext} ${-bak} ${*-ext}try on your machineexplain this command
-
rename:tldr:54bba rename: Do not overwrite existing files.$ rename -o ${foo} ${bar} ${*}try on your machineexplain this command
-
rename:tldr:5fd5b rename: display which renames would occur without performing them.$ rename -vn ${foo} ${bar} ${*}try on your machineexplain 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 machineexplain this command