Wednesday, September 13, 2006

Changing file extensions in bash

for f in *.old; do mv "$f" "${f%%\.old}.new"; done

The quotes take care of possible spaces in the filename.

No comments: