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
Written by r.kachowski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command-line
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#