bulk rename

for i in `find *.txt` ; do mv $i ${i/txt/html}; done

I should never forget this, this was a failure :(

Edit: The bug (pointed out by Viral) in above expression is that if a filename is txt.txt, it will make it html.txt. So here is the fix:

for i in `find *.txt` ; do mv $i ${i/.txt/.html}; done
Advertisements

6 thoughts on “bulk rename

  1. second one was taken by me… :D :D….
    we have some other photoes with the same theme (i.e. whole dark photoes) i’ll soon upload them also..
    and ya, we went this sunday… enjoyed a lot..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s