Tuesday, October 7, 2008

Over come rm command limitation

To delete a large number of command when rm command fails.

 echo * | xargs /bin/rm -f

or use this 

find /path/to/files/ -type f -exec /bin/rm -f {} \;

or

ls | xargs rm -rf *

Finding all .mp3 files and move to new directory from shell prompt

find / -iname "*.mp3" -type f | xargs -I '{}' mv {} /mnt/mp3

No comments: