shell

Recursively renaming files in Linux

This tutorial explains how to rename all files in a directory and its subdirectories. Or just how to rename multiple files at once in Linux.

This can be done with one very simple command:

rename some other `find . -name '.*'`

This will replaces all occurences of 'some' in file names with 'other'.

A simple example: rename all htm files to html.

rename htm html `find . -name '*.html'`

The rename command takes 3 arguments:

  1. thing to replace
  2. thing to replace it with
  3. a list of files to apply it to
Syndicate content