unix - how to rename multiple files.

chris (2007-10-22 09:02:18)
1893 views
0 replies
To rename multiple files in unix or linux, use the 'rename' utility. It renames files in bulk. For example, if you want to rename all your '.html' files to '.php', you can use rename with a single command line statement. First check that you have it on your system:
chris@chris-laptop:~$ which rename
/usr/bin/rename

Then use 'rename' as follows to carryout the renaming of files in your current working directory:
chris@chris-laptop:-$ sudo rename 's/.html/.php/' *html

Hope that's useful.

christo
comment