Friday, October 28, 2011

Extract archives with Linux find

Example:
~/Folder/A/a.rar
~/Folder/A/a.nfo
~/Folder/B/b.rar
~/Folder/B/b.nfo
Extract all archives in Folder subdirectories and delete them afterwards:
Linux terminal:~$
cd Folder 
find . -name "*.rar" -execdir unrar x {} +
find . \( -name "*.rar" -o -name "*.nfo" \) -execdir rm -r {} +

Labels: , , , ,

comments powered by Disqus