Bulk File Renamer


/ Published in: Bash
Save to your folder(s)

Description:

This script will loop through all the files in a directory and rename them to match
the name contained inside of a text file. This makes it easy to bulk rename files
by working iteratively in a single text file, until it contains a list of the file
names you want.

Instructions:

1) cd into the directory that contains a list of all the files you want to rename.

2) Type: \ls -1 ../replace.txt

3) cd ..

4) Edit replace.txt but don't change the order of any lines.

5) ./bulk-renamer.sh [directory of files to rename] replace.txt

6) If you don't like the results, just delete replace.txt and start over with step 1

Additional Instructions:

If you are careful, you can also rename just a subset of files in a directory by modifying step 2 to include a wildcard filter to the files you want to rename such as: *.mp3 but you will also need to change the "for loop" below to use the same wildcard filter

Usage: ./bulk-renamer.sh [directory to CD into] [path/to/replace.txt]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.