How to rename many files at a go in Linux
How to rename many files at a go in Linux
In pretty much any Linux-based operating system, it is possible to Rename many files once. This is a built-in functionality, so there’s no little extra packages that you will need to use this Linux feature!
The process is surprisingly very easy. Follow the following steps;
Step 1
Select all the files/directories you want to rename. You can use Shift or Ctrl keys while selecting.
NOTE:// If for whatever reason you want to rename files && directories at a go, this too is very possible! For the Step 1, select files && directories to rename.
Step 2
Right click on any of the selected files or directories OR files and directories, and click on the “Rename“ option.
Alternatively, press on the rename shortcut on your Keyboard; F2 (Function key 2). If your keyboard has the function keys assigned to secondary operations, for instance, “Volume Decrease” or whatever other operation, make sure to use the Function key “Fn” on your keyboard before pressing “F2″, that is, Fn + F2!
Another option is to use the “Options” key and clicking on Rename, which depending on your computer could be a dedicated key or a secondary functionality combined in the right Ctrl key. You will know the key by looking for a hamburger menu. If it is in the Ctrl key, make sure to use the Fn key to access it, like Fn + Ctrl!
The result of any of the above steps is a Rename window, title of the window being “Rename x files/folders” or “Rename x files and folders” if you selected files and folders.
Step 3
There are actually two options to rename any number of files and/or directories/folders;
1. Rename using a template
In this option the default option will be to add characters after the original name of all your selected files and/or directories. The original name for all files/directories will be represented by “[Original file name]” prefix. You can change the position of your cursor to the beginning of “[Original file name]” if you want to add characters to the beginning of the original files and/or directories names.
Still under this template option, you have the ability to add “Automatic Numbers“, before or after the “[Original file name]“!
The last alternative under the template option is to overwrite the “[Original file name]” of all selected files/directories names, by deleting the “[Original file name]” parameter and writing your own custom name. If you decide to go with this option, use it with the “Automatic Numbers” feature to uniquely identify each file/directory.
2. Find and replace text
In this Rename option, you just enter “Existing Text” (character(s) that are in one or all the files/directories names) that you wish to find and replace, and under “Replace With“, enter the character(s) you want to replace the existing text with!
NOTE:// You can find one or more than one characters under “Existing Text” and you can also “Replace With” one or more characters. For two or more characters, you have to enter the characters as they follow one another in the original files/directories names.
NOTE:// You cannot replace characters that are at different positions at a go. You will have to complete one replacement and complete the Rename process before doing the next replacement of chareacter(s). For instance, if you wanna replace both “en” and “s” in “Documents”, you will first find and replace either “en” or “s” before finding and replacing the next.
NOTE:// This is Linux, and therefore case sensitivity applies in this Find and Replace process, as it does in other parts of Linux. Therefore, a letter “D” in “Documents” will not be found in a search for “d”.
How to rename many files at a go in Linux
Hacking | thetqweb