You get a bonus - 1 coin for daily activity. Now you have 1 coin

Recursively renaming file extensions in Ubuntu

Practice



 

if you need to rename all files with a given extension (.PNG)  to a new one (.png) taking subfolder nesting into account, you can use the following command

 

find . -name "*.png" -exec pngout {} \;

 

 

if you need to rename, only in the current directory, all files that have the extension (.PNG) to the new extension (.png), use the command 


rename 's/.PNG/.png/g' *.PNG

 

 

note — no spaces inside the quotes

 

the command uses the following parameters

s=  substitution required.

/.PNG/=the string that will be replaced.

/.png/ = the string it will be replaced with

g=global, meaning,  all found occurrences will be replaced.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system