> Can someone tell me how I would rename all files in a folder and subfolders
> to lowercase filenames please.
Assuming you want to rename the directories as well as the files:
find /path/to/folder -print | while read x ; do
mv $x $(echo $x | tr 'A-Z' 'a-z')
done
... should do the trick. If you don't want to rename the directories,
things are a little trickier; you'll have to pass the filename part
to tr, not the directory part:
find /path/to/folder -type f -print | while read x ; do
mv $x $(dirname $x)/$(basename $x | tr 'A-Z' 'a-z')
done
Colm
--
Colm Buckley, NewWorld Commerce, 16 South Cumberland St., Dublin 2, Ireland.
Personal: +353 87 2469146 / colm at tuatha.org / http://www.tuatha.org/~colm/
Business: +353 1 4334334 / colm at nwcgroup.com / http://www.nwcgroup.com/
You need to log into www.clue.com and issue the GET command.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!