Bulk rename files in bash

Needed to rename a bunch of files and didn’t want to write a program. Bash one-liner below did the job.

I had a VMware guest I wanted to clone. Copied the whole guest directory to another but then had to rename all the files within. Here’s my command syntax for that:

ls linuxc* | awk '{print("mv "$1" "$1)}' | sed 's/linuxc/linuxd/2' | /bin/sh

Found this here. Yes, it appears that Mac users can indeed invent useful one-liners in bash — something I at least am thankful for.