summaryrefslogtreecommitdiff
path: root/bulk-rename-from-file
blob: 862658063360264b42bdfe05245369e72a866f46 (plain)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash

# Rename a whole directory of files to strings listed in a text file.

j=1

for i in *; do
    mv "$i" "$(sed -n "$j"p ../fileNames.txt)";
    j=$((j=j+1));
done