Thursday, March 12, 2009

How to add Prefix or Suffix to all file names in a folder ( Linux)

Command sequence to rename all files with a prefix.
for x in `ls -d *`; do mv $x .$x; done

Command sequence to rename all files with a suffix.
for x in `ls -d *`; do mv $x $x.; done

No comments: