BASH: Massrename files
Mass-renaming files in a folder using bash. Got those files after someone did a weird “database dump with csv interaction”… Whatever. Let’s cleanup those poor files please.
List the files:
# cd /path/to/my/files # ls -l file1;asdf file2;2435 file3;dfg file4;sdf
# for file in $(find . -type f); do new=`echo $file | cut -d ";" -f 1` mv $file $new done
List them again:
# ls -l file1 file2 file3 file4