Procrastiblog

September 13, 2006

Changing file extensions in bash

Filed under: Tech — Chris @ 9:30 pm

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

The quotes take care of possible spaces in the filename.

Advertisements

Blog at WordPress.com.

%d bloggers like this: