| Liam Delahunty: Home | Tips | Design | Web | Words | Links | Contact |
|---|
|
Panda Internet Security 2007 - $15 Discount Coupon Download Free Web Design Software Here Sponsors: Think I deserve a present? See my Amazon Wish List |
Linux - Renaming FilesRenaming multiple files in a single directoryI tried the following "script" in a shell...
with the intention of renaming all the files in a folder from .php3 to .php... WRONG Instead, I now have *.phpp (BTW I repaired my error with rename phpp php *.phpp) This would have worked: for file in *.php3 do mv $file `basename $file .php3`.php done ...or... for i in *.php3; do mv "$i" `echo "$i" | sed 's/\.php3$/.php/'`; done
Please also see how-to rename a single file or a directory Share this! Linux Rename Directory | Linux Rename Files | Linux Search And Replace Multiple Files Link here: |