commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Parallel does not suffer from the risk of mixing of output that xargs suffers from. -j+0 will run as many jobs in parallel as you have cores.
With parallel you only need -0 (and -print0) if your filenames contain a '\n'.
Parallel is from https://savannah.nongnu.org/projects/parallel/
There are 3 alternatives - vote for the best!
xargs -P N spawns up to N worker processes. -n 40 means each grep command gets up to 40 file names each on the command line.
If you can do better, submit your command here.
You must be signed in to comment.