Friday, March 7, 2008

Simple Bulk rename : A Bash file rename script

often I have to rename a whole set of files that have not processed correctly, to do this I rename them with Bash, a simple script to do this is :

for f in *_3; do mv "$f" "${f/_3/_0}"; done

this renames all files ending in _3 to the same filename but now ending in _0

No comments:

Post a Comment