Skip to content

October 24, 2016

Rename Multiple Files in Linux

by linux

To rename multiple files in Linux run from the command line:

for f in *.cc; do mv -- "$f" "${}.cpp"; done

Previous command will rename all .cc files into .cpp files.

Note: It will not work recursively. To rename recursively use the following command:

find ./ -type f -exec rename 's/.mm/.cpp/' '{}' \;
Read more from Linux Quick Tips

Leave a Reply


Note: HTML is allowed. Your email address will never be published.

Subscribe to comments