Monday, April 20, 2009

bash script, spaces in filenames

Delete all mp3s. Don't ask why...
find . -name '*.mp3' |while read FILE; do rm "$FILE"; done


List disk usage for all items in a dir
ls |while read i; do du -sh "$i";  done

This is easier done with
du -sh *

but it's the usage of "while read" I wanted to show.

2 comments:

Jorge said...

Thanks for that, was wondering how to remove spaces from filenames and you helped me quite a lot.

Anonymous said...

The dial is cushion shaped, but the case itself is actually round.
http://www.watchestoo.com
replica watches
rolex
rolex oyster perpetual datejust watch
rolex oyster perpetual datejust replica watch
rolex oyster perpetual datejust
rolex ladies datejust
IWC
IWC Aquatimer
IWC Da Vinci
IWC INGENIEUR
IWC Vintage collection
IWC other
IWC Pilot's watches Classics