简体   繁体   中英

using xargs to unzip multiple files

I'm trying to unrar a tonne of files in a directory using xargs...

having little luck with this command:

find /home/jchristian/bfdata/2014/*.rar -print0 | xargs -0r unrar x

gives the following output:

UNRAR 5.00 beta 3 freeware      Copyright (c) 1993-2013 Alexander Roshal
Extracting from /home/jchristian/bfdata/2014/bfinf_horse_140106to140112_140115120001.rar

No files to extract

Yes, When I run unrar with that file outputted above - It extracts gracefully...

unrar x     /home/jchristian/bfdata/2014/bfinf_horse_140106to140112_140115120001.rar

UNRAR 5.00 beta 3 freeware      Copyright (c) 1993-2013 Alexander Roshal


Extracting from   /home/jchristian/bfdata/2014/bfinf_horse_140106to140112_140115120001.rar

Extracting  bfinf_horse_140106to140112_140115120001.csv               OK 
All OK

Any ideas?

this should work

find /home/jchristian/bfdata/2014/ -name *.rar | xargs -n 1 unrar x

find need a path and an expression, so

find /home/jchristian/bfdata/2014/*.rar -print0

will return nothing

You could skip the xargs step by using find -exec

find /home/jchristian/bfdata/2014 -name \*.rar -exec unrar x {} \;

You need e or x after unrar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM