Rename File In Linux – Want to change the file name on Linux? In most Linux versions, all you have to do is right-click on the file and select the Rename option.
But that was just the beginning. Changing file names on Linux may be easier and more interesting than you think. And you don’t have to deal with the command line again to start having fun. There are many functions provided in the default OS file manager. Following is the Rename File In Linux tutorial:
Rename Files in Linux
Rename Files with Default File Manager
If you have a record or folder worth one semester that is filled with holiday photos, changing file names one by one will take a whole day. Luckily we don’t have to do it and maybe even don’t need to install additional applications to simplify the work.
If you use a standard version of Ubuntu or Fedora, two popular Linux forms, the desktop interface that we see is known as GNOME. You can rename multiple files and marking everything, right-clicking the mouse or touchpad, then choosing Rename. While GNOME is currently the most popular Linux desktop interface, there are also many others. Is it possible to rename multiple files at once, and the method can vary.
If you prefer KDE or Xfce (Dolphin and Thunar) file managers, you are also free to use their application without switching completely to the desktop.
Rename Files With PyRenamer
Depending on your needs, you might need a more sophisticated program. Renamer will make us not need to enter the Command Line.
Want to rename all your photos according to the date and time? Want to enter artist, album and track titles in the name of each MP3 file? Want to sort papers based on semesters and courses? This is the type of application that you can use.
When opening pyRenamer, we will see the navigation pane on the left to explore the folders and panels on the right to select files. The latter will show how files are seen before and after renaming. The menu panel on the right allows us to save file extensions and see changes to the preview automatically.
At the bottom, where you enter the name pattern you want to see. Hover over the text form to see which patterns can be used. Options include numbers, creation date, time, image metadata, and audio tags.
We can save the pattern after it’s finished by clicking the Save icon next to each section. The adjacent icons allow opening existing patterns, so you don’t have to remember the complicated formulas used for your photos and music.
You can install by opening the terminal and typing the following command:
sudo apt-get install pyrenamer
Renaming Files With KRename
KRenamer will suit most Linux desktops. But if you use the KDE Plasma desktop, you can choose applications written in the Qt programming language. Such software tends to integrate better with other interfaces.
In this case KRename. Its functionality is similar to pyRenamer, only with tab views that might be considered easier to navigate.
The advantages of KRename come from the plugin, which occupies the third tab. You can activate more sophisticated features, such as ability to transliterate file from other language. To be able to install KRename on Ubuntu and many desktops based on Ubuntu, following command:
sudo apt-get install krename
How to Change File Names in Terminal
The terminal may seem boring, but there are many benefits. Command in the terminal is usually the same in various versions of Linux. The following rename command works regardless of the selected Linux desktop operating system or desktop environment. This also works on servers without a desktop at all.
There are two core commands that make it easy to change file names. The easiest choice is not very clear, so let’s try first.
Rename files using the Linux ‘mv’ command
mv command is simple. Look at the example below.
mv / home / user / Downloads / old-file-name / home / user / Downloads / new-file-name
Or, you can open or direct the terminal to the folder containing the file.
cd / home / user / Downloads /
mv old-file-name new-file-name
Note: If you really want to move files using the mv command, instead of entering a new file name, just type the target directory.
mv / home / user / Downloads / old-file-name / home / user / Documents /
Rename files using Linux ‘rename’ Command
Let’s say you have a lot of text files (TXT) that you want to convert to a Markdown (MD) file. First, as in the example above, use the cd command to get to the relevant folder (or, you might be able to use Right Click> Open in Terminal). Then, enter the following command:
rename .txt .md *
The * sign tells the command to search all files in the active folder. You can explicitly limit searches to files ending in .txt by modifying the command as follows.
rename .txt .md * .txt
The above command will not tell what changed the command rename. So we have to open the folder and check it ourselves. If you want confirmation in the terminal, you can add -v to the command.
rename -v .txt .md *
Technically, we can use the rename command to rename one file. You only need to do more typing than you do when using mv. As an example:
rename old-file-name new-file-name old-file-name
Repeating the original file name at the end, instead of using *, tells the command to only take action on one particular file.
How Do You Manage Files on Linux?
Now we know how to change file names using file manager and command line. What about other tasks?
Apparently, the terminal can replace the function of a File Manager. This provides a quick way to list, move, delete, copy, and paste data on a computer. Learning Linux is fun right? Hopefully information Rename Files In Linux can be useful and help you.