Skip to content
Related Articles

Related Articles

rename command in Linux with Examples
  • Difficulty Level : Basic
  • Last Updated : 24 May, 2019

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.

Syntax:

rename [options] expression replacement file...

Options:

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

    Example:

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



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

    Example:

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

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

    Example:

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

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

    Example:

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

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

    Example:

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

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

    Example:

    rename -help

My Personal Notes arrow_drop_up
Recommended Articles
Page :