Last Updated: February 25, 2016
·
406
· rkachowski

I want to rename a ton of stuff in this folder! but not by hand!

well son, here's how it's done

ls * | sed 'p;s/from_this_name/to_this_name/' | xargs -n2 mv

sed -p means print the original (as well as the output
xargs -n2 means take two arguments from whatever was piped in

so we just list everything, do a sed in place, and then pipe that output to mv and all is peachy

woopty doodle