I am using multi-procs in 'xargs' to process a bunch of zip files. How to display the count of files processed in multi-procs??

find -type f -iname \*.zip | xargs -IZ -P 5 sh -c 'unzip "Z"'

How can i get the current number of file being processed..? I just would like to know how many files already processed so far..? Suppose i have 1k zip files i need to know how many zip files processed so far like.. "Processing file: 200" "Processing file: 400" or "Processing file: 405 of 1000"


  • btw. why not just |xargs -P5 unzip ?
    – pawel7318
    Sep 15, 2017 at 10:24
  • ooh okay.. thanks for the comment.. usually.. i might need to extract the files to a specific directory and specific files hence sh -c enables me to perform those tasks.. find -type f -iname *.zip | xargs -IZ -P 5 sh -c 'B=/some/new/$(basename -s .zip "Z") ; unzip "Z" '*.tiff' -d $B' Sep 15, 2017 at 10:44

1 Answer 1


Try to:

find -type f -iname \*.zip | xargs -IZ -P 5 sh -c 'unzip "Z"; echo "Z" >> done.txt'

and wc -l done.txt to see how many are done or cat done.txt to see the list of them.

Please note that it'll fail if new line character is present in any file name. If you have some than use echo one_more instead of echo "Z" to get at least what you asked for.

  • i need to track the number of files processed. Sep 15, 2017 at 10:47
  • yes, so use wc -l done.txt from another terminal or even watch wc -l done.txt as you like
    – pawel7318
    Sep 15, 2017 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .