Let us say you have few files to be renamed and you would like to rename the files in bulk. Old names and new names are present in two columns in a separate file and are separated by tab (or any delimiter that is unique between two columns).
Example file:
Old_file New_file
boomer genZ
You can change the file names in multiple ways:
- awk -v OFS=" " '{print "mv",$1,$2}' file.txt| sh
- while IFS=$'\t' read old new; do echo mv $old $new;done < test.txt