The K Desktop Environment

Chapter 2. Using Krename

Most controls have useful tooltips with examples and more explanations. If you need help, point with your mouse cursor on the control you need help to and wait some seconds. A small tooltip will pop up.

Index:


Commandline Arguments

Krename supports only a few commandline arguments at the moment.
You can add files or dirs to krename, if you start it with this files/dirs as arguments:
                % krename myfile1 /home/ /opt/file2
              
It is also possible to add directories recursively using the commandline. You have to add -r dirname. Directories starting with a . (hidden directories) are ignored. Try a:

                % krename -r /home/
              

If you don't want the realtime preview, which can make Krename very slow if you try to rename many files, you can add the --nopreview option.
                % krename --nopreview
              

Adding Files

After krename started it wants you to add all files that should be renamed to a list.
There are several ways of adding files to krename:

You can open or preview files by either double clicking on them or selecting them and pressing RETURN. It is also possible to drag files from krename in your favorite application (e.g. an image viewer).

Destination

The second step is to select a destination for the renamed files. Krename has 4 options:

If you select overwrite existing files, exiting files will be overwritten, otherwise not.

Changing date & time

Krename can change the modification date & time of any file and the time of the last access. It should be plenty easy to understand. Changing date & time of symbolic links is not possible, because they of always the same date and time values as their target.

Permissions

Krename can change filepermissions and file owner, too. Setting permissions works the same way as in the Konqueror file properties dialog. It is not possible to change permissions or owner of symbolic links. Another limitation is that only root can change the group of a file (it is not really a limitation, more a security feature of Linux or *BSD :).

Filename / Template

Krename renames the files using a given template. A template is, in krename, a text that discribes how the final filename should look using a set of tokens.

By default krename doesn't allow to change the file extension, because krename adds automaticly the extension of the input file to the output file. That means that file has after being renamed the same extension as before. You can change the extension manually with unchecking the checkbox Use original file extension. A second texfield after template becomes enabled and allows you to specify a file extension of your own.

An example for a template would be picture### and for the extension template png. As a result all files will be renamed to:
picture000.png, picture001.png, ..., picture044.png, ..., picture100.png
The more # you add the more 0's will be added in front of the number. E.g.: picture####### would result in picture picture0000001. If you don't want krename to give the first file the index 0, adjust it using the start index control.
Another example tempalte is: & -> result: filename of the inout file converted to upper case. take a look at the Syntax and try the other options. To start with the renaming process press Finish.

Skipping numbers

Krename can skip certain numbers during the renaming process.
Click on the button Skip numbers and add all numbers that should be skipped to the list in the dialog window. All numbers in the list will not be assigned to a file. E.g.: If 2, 3 and 5 should be skipped and the file template is file#, the files will be renamed to: file0, file1, file4, file6, ... .

Syntax

Token

Explanation

Explanation in file extension template

$ old filename old file extension
% old filename converted to lower case old file extension converted to lower case
& old filename converted to upper case old file extension converted to upper case
§ old filename converted to lower case, but first letter converted to upper case old file extension converted to lower case, but first letter of the extension converted to upper case
* old filename converted to lower case, but first letter of every word converted to upper case old file extension converted to lower case, but first letter of every word the extension converted to upper case
# Adds a number to the filename Adds a number to the file extension
[x-y] Characters x to y from the old filename can be converted using the §,% and & operators Characters x to y from the file extension
[x;y] y characters from x from the old filename y characters from x from the file extension
[date] add current date add current date
[time] add current time add current time
[year] add current year add current year
[month] add current month add current month
[day] add current day add current day
[hour] add current hour add current hour
[minute] add current minute add current minute
[second] add current second add current second