Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anyway to check the number of file in a directory, if the number of files is correct, say 5 files, zip the files with zip -r If the number of files is wrong, wait 3 seconds, and check the number of files again. Keep repeating until either correct, and exit or timeout.

Is there anyway to do the case above, I have huge files that is in several part in a folder, and I want to zip it only after the file finish merging using cat command. the individual part will be remove as it is finish merging.

share|improve this question
How do the files arrive in the directory? – suspectus Mar 29 '13 at 0:19
using html5, files bigger than 100MB arrive in part, after all part arrived for single file, it will be merged as the original name using cat command, and then it will the part will be removed. the problem is I'm not sure when the merging process finish – user212334 Mar 29 '13 at 0:53
would you know when the 5th file say has been completely written to the directory? It could be there - but not in complete form. – suspectus Mar 29 '13 at 1:10
Yes, the merge command only run after the parts uploaded – user212334 Mar 29 '13 at 1:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.