1) Please use ***
[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do
not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
2) There have been many, many previous threads on how to bulk rename files in the shell. A bit of searching through the archives would certainly have turned up the answers you needed. We'd be here afterwards if you still needed help.
But for my own suggestion, I'm assuming that the OP just has two files, with each line in the first file having the old name, and with the second file holding a corresponding new name.
For that I'd recommend a couple of simple bash
arrays:
Code:
mapfile -t oldname <file1.txt
mapfile -t newname <file2.txt
for i in "${!oldname[@]}"; do
echo mv "${oldname[i]}" "${newname[i]}"
done
It also assumes one line per name pair, with none of the names containing newlines themselves, and that the filenames either exist in the current directory or have absolute paths.
I added an
echo to the front of
mv so you can confirm the commands before actually executing the changes. Just remove it when ready.