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:
find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8
will encode all .wav files into FLAC in parallel.
Explanation of xargs flags:
-P [max-procs]: Max number of invocations to run at once. Set to 0 to run all at once [potentially dangerous re: excessive RAM usage].
-n [max-args]: Max number of arguments from the list to send to each invocation.
-0: Stdin is a null-terminated list.
I use xargs to build parallel-processing frameworks into my scripts like the one here: http://pastebin.com/1GvcifYa
There are 3 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.