Skip to main content
added 380 characters in body
Source Link
amphetamachine
  • 5.6k
  • 2
  • 38
  • 43

To expand on the answers already provided, xargs can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8
find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

Update 2024:

GNU Parallel, initially released 2020-05-22, is another tool that may be better suited to parallelizing processes. Here's the same command as above using parallel instead:

find . -type f -name '*.wav' -exec parallel --jobs=3 flac -V8 ::: {} +

Omit --jobs=3 to auto-utilize all CPU threads at once.

To expand on the answers already provided, xargs can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

To expand on the answers already provided, xargs can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

Update 2024:

GNU Parallel, initially released 2020-05-22, is another tool that may be better suited to parallelizing processes. Here's the same command as above using parallel instead:

find . -type f -name '*.wav' -exec parallel --jobs=3 flac -V8 ::: {} +

Omit --jobs=3 to auto-utilize all CPU threads at once.

Rollback to Revision 1
Source Link
amphetamachine
  • 5.6k
  • 2
  • 38
  • 43

To expand on the answers already provided, some xargs implementations (like GNU or modern BSDs) can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

To expand on the answers already provided, some xargs implementations (like GNU or modern BSDs) can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

To expand on the answers already provided, xargs can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

added 47 characters in body
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

To expand on the answers already provided, some xargs implementations (like GNU or modern BSDs) can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

To expand on the answers already provided, xargs can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

To expand on the answers already provided, some xargs implementations (like GNU or modern BSDs) can do one cool thing that is becoming increasingly important in today's multicore and distributed computing landscape: it can parallel process jobs.

For example:

$ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8

will encode *.wav => *.flac, using three processes at once (-P 3).

Source Link
amphetamachine
  • 5.6k
  • 2
  • 38
  • 43
Loading