I need to change the postfixes of all files (all the same .JPEG) to .jpeg (Capital vs. lower case).
Is there a quick way of doing so?
|
|
|
Use the Perl program
The first argument is a Perl regular expression matching filenames ending with The second argument selects the files that should be matched, in your case every file in the current directory ending on
Other answers I've seen:
|
|||||||||
|
|
There is a tool for this:
(if not already installed) where you can do (from command line):
|
||||
|
|
|
Found it a second after posting:
|
|||||
|
|
Use the rename command. It's different than move and often is causes confusion because it was specifically created with picture renaming in mind. Something like this command should work (for all files that end in .JPEG, change .JPEG to .jpeg) rename -n 's/.JPEG$/.jpeg/' *.JPEG |
|||
|
|
|
Doing things in parallel is getting more and more important, hence I recommend:
This utility is not installed by default though. |
|||
|
|
Although this is possibly not the best solution for this particular usage case,
also works. We can do some trickyness with bash in order to slightly increase efficiency (avoiding in invocation of an additional sub-process in the inner loop), ending up with:
This solution is most useful if you want to do something else in additon to renaming the files, such as logging what names were changed, or even just doing a dry run to ensure that it does what you want. |
|||||
|
|
If you are looking for a nice GUI solution and don't want to muck about with complicated command line arguments, there is a great Nautilus script available to rename files. It has a simple interface and many options. Available here: http://gnome-look.org/content/show.php/Renamer?content=87601 |
|||
|
|
