rename command in Linux with Examples

rename command in Linux is used to rename the named files according to the regular expression perlexpr. It can change the name of the multiple files. If the user will not specify any file names on the command line with this command then it will take the file name from the standard input.


rename [options] expression replacement file...


  • rename -s: This option renames the files ignoring the symbolic links.


    rename -s 's/root/new/' sym.png

  • rename -v: This option is used to show which files is being renamed, if there is any.


    rename -v 's/jpeg/png/' *.jpeg

  • rename -n : This option comes into play when the user wants to see only the final change.


    rename -n 's/png/jpeg/' *.png

  • rename -o : This option will not going to overwrite the existing files.


    rename -o 's/jpeg/png/' *.jpeg

  • rename -V: This option will show the version information and exit.


    rename -V 's/jpeg/png/' *.jpeg

  • rename -help : This option will going show the help message and exit.


    rename -help

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.