How to Batch Rename Files in KDE

KDE is the desktop environment of choice for many of the world’s Linux, BSD, and Unix users. It is easy to use and provides a solid graphical interface for many advanced operating system features.

One of those advanced features is the ability to rename a large number of files at once. This saves a tremendous amount of time for people who do this frequently. For example, a photographer may have 300 pictures in a folder and needs to have them all follow a particular naming scheme. The original files might be named something like 100_38239_3.jpg, and the photographer might want them to have the name of the location followed by the date, and time of photos. With KDE, this is easy.

Renaming Files

First, you will need KDE and its default file manager: Dolphin. Even if you do not use KDE as your default desktop environment, you can install Dolphin from your Linux distribution’s software repository. You can even install it for Mac OS X or Windows.

To rename one file in Dolphin, simply right click on the file and click “rename”. A dialog box will appear asking you to enter the new name. It will allow you to change the entire name of the file, including the file extension, so use it with caution. Alternatively, you can rename a selected file just by pressing the F2 key.

To rename multiple files, do the following:

1. Select all of the files you want to rename. You can highlight them, click the green plus emblems over each icon, or press CTRL+A to select all the files in a folder.

2. Right click and click “Rename” or press “F2”

3. It will ask you to rename the selected number of items. The “#” will be replaced by ascending numbers. Replace “New Name” with the naming scheme you want.

4. Click “Rename”.

That is all you have to do. Your naming scheme can be as simple or complicated as you want. For example, you could change “file1.txt, file2.txt, and file3.txt” to “Case1_Day1.txt, Case1_day2.txt, and Case1_Day3.txt”. You can also place the “#” anywhere you want. For example, if you typed “Case_#_Midland.txt” where “Midland” is the location of the case study, the files would be named “Case_1_Midland.txt, Case_2_Midland.txt” and so on.

You can also assign the number of places you want your file numbers to have. For example, if you input “Case###.odt”, it will assign the Open Document files leading zeros so that they look like this:

Case001.odt

Case002.odt

Case022.odt

Case123.odt

Renaming with KRename

In some situations, the simplicity of ascending numbers is not enough. For those instances, KRename will give you more options over how your files are named. For example, you can select “Insert Date/Time”, and it will use the format you specify. The default “%Y%m%d” will display Year/Month/Day.

“Search and Replace” allows you to replace certain characters in each filename with any others you specify, and “Remove Characters” allows you to remove them completely. KRename gives you the option to select the position of the information you want to insert and how you want that information to be inserted. You can perform the task with as many files as you like, and they do not all have to be from the same folder, giving you complete flexibility over your renaming scheme.

For more information about renaming files in KDE, UK domain names company 34SP.com recommends consulting the KDE Tech Base. For specific information about Dolphin or KRename, consult the help documentation for each.