Friday, January 30, 2009

replace a string from name off all files in a directory.

To replace a particular string from the name of all files in a
directory follow the below steps

  • create a file script.sh and change its permission to 644
  • write the below thing in the script
here in the below example we are replacing the string in with all from
all files in the directory.

for f in *-in.wav; do mv "$f" "${f%-in.wav}-all.wav"; done

No comments: