Skip to content

Archive for

24
Oct

Rename Multiple Files in Linux

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

for f in *.cc; do mv -- "$f" "${f%.cc}.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/' '{}' \;