Log in

No account? Create an account
Overloading the Machine -- Day [entries|friends|calendar]

[ website | wjsullivan.net ]
[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

Change the Extensions of Multiple Files [09 Sep 2004|01:45am]

This example changes the extensions of all the files in the current directory that end in .html to .txt.

for a in *.html; do mv "$a" "$(echo "$a" | sed 's/html$/txt/')"; done

So, to convert all of the .jpg's in a directory to .xpm's, which I needed to do in order to set up a library\ of .xpm background images for my aterm to randomly choose from, do:

for a in *.jpg; do convert "$a" "$(echo "$a" | sed 's/jpg$/xpm/')"; done

post comment

[ viewing | September 9th, 2004 ]
[ go | previous day|next day ]