I would like to add prefix on all folders and directories.
Example:
I have
Hi.jpg
1.txt
folder/
this.file_is.here.png
another_folder.ok/
To add a prefix to all files and folders in the current directory using util-linux's rename
(as opposed to prename
, the perl variant from Debian and certain other systems), you can do:
rename '' *
This finds the first occurrence of the empty string (which is found immediately) and then replaces that occurrence with your prefix, then glues on the rest of the file name to the end of that. Done.
For suffixes, you need to use the perl version or use find.