Pages

Monday, April 8, 2019

rename Command

About rename

The rename command is used to change the name of multiple files.This command is slightly more advanced than mv because it requires the knowledge of, or at least a basic familiarity with, regular expressions.

We have two versions of rename package, a simpler version and a perl based version. perl based version has more advanced features.

If you have the simpler rename installed, you will see something like this instead.

       
$ rename --version 

rename from util-linux 2.33.1      
 

Perl based rename has below type of version.

       
$ rename --version

perl-rename 1.9
In this post, we are going to see the example for simpler version.

Syntax : rename 'old pattern' 'new pattern' input files

example : If you want to replace txt to text, below is the syntax
       
 rename 'txt' 'text' *.txt
       

No comments:

Post a Comment