Posts Tagged With: rename

Rename Command

Tagged with: , , , ,

Different way to use the rename command.

rename 's/.html$/.php/' *.html
No Comments »

Rename an User Group

Tagged with: , , , ,

Rename a group

groupmod -n new_group_name old_group_name

Command to Replace a String in all Files in Current Directory

Tagged with: , , , ,

Replaces all instance of ‘<old string>’ with ‘<new sting>’ in all the files of the current directory.

perl -pi -e "s/<old string>/<new string>/g;" *


No Comments »

Change the Extension of Multiple Files in Linux

Tagged with: , , , ,

In this example, we will change all files with extension ‘.info’ to ‘.txt’.

Rename all *.info files in one folder

rename .info .txt *.info

That should read as..

rename <replace this string> <with this string> <in all these files>

Do the same operation recursively in a directory tree

find . -name "*.info" -exec rename .info .txt {} \;

Those double quotes around *.info are important – don’t remove them mm-kay?