Wednesday, June 22, 2022

renaming all the files in a folder

 IF we want to rename all the files with a part of the file we can do something following:

for file in $(ls); do nn=$(echo $file | awk -F'_' '{print($2)}'); mv $file $nn; done