So I am supposed to find all the files in the given directory with surffix of .C or cc, and change their name to .C.blah or .cc.blah
Is there a command to do that?
Or should I implement this with the command find?
There are a few approaches, depending on what is available on your *nix.
There two different
utils version - you might be able to do this with one line:
I know you already found your own acceptable solution, but I want to post what I would normally use at work. This syntax works for GNU findutils, which is part of any modern linux distro.
Especially with the now common quad-core SMP servers, you can usually half running time with
use a simple for-loop:
This command echoes the old file name and the new file to the terminal. If you're getting expected results, go for the real command:
Anyway, this won't rename *.txt files in subdirectories. Use find for it.
There are two different
On Ubuntu/Debian/... distros:
On RedHat/CentOS/... distros: