[Ilugc] [Help] Renaming files through bash shell scripts

  • From: knura9@xxxxxxxxx (Arun Khan)
  • Date: Tue, 3 Nov 2015 10:14:29 +0530

On Wed, Oct 28, 2015 at 12:56 PM, Baskar Selvaraj <baskar at linuxpert.in> 
wrote:

Dear all,

I am looking for a simplified solution for renaming files through shell 
scripts.


Dangerous, unless your file name string has an unique pattern.
Otherwise, you might end up overwriting already renamed files!

As the discussion shows it can be done in many ways!  The perl purist
would probably give you a one liner :)  and there are others like
bash, python and ruby (Shakti Kannan's solution).

mmv (mass rename/move) comes to my mind -- details 'man mmv'

Also this links provides some good bash examples
<http://www.peteryu.ca/tutorials/shellscripting/batch_rename> that I
found through uncle Google.

The above maybe moot in your case but posting here for future
reference, in case it comes up again.

-- Arun Khan

Other related posts: