Additionally, you can run a series of unrelated commands that aren't from a list/piped in with parallel using the `--` syntax:
`parallel -j 3 -- ls df "echo hi"`
You can limit system load using parallel, which as far as I know isn't possible with xargs: `parallel -l L` where L is the average system load you want to remain beneath.
- Splitting input lines into multiple fields and building more complex commands from them
- Running jobs on remote nodes
- Pausing/resuming batch jobs (--joblog)
- ETA and progress bars
- Passing data to programs on stdin and generally many, many other ways of distributing and collecting data that xargs can't do
You can see a bunch of examples at: https://www.gnu.org/software/parallel/man.html
$ PAGER=cat man xargs | wc -l
259
$ PAGER=cat man parallel | wc -l
3985PAGER="wc -l" man xargs
(although my man page for xargs is just 211 lines)
MANWIDTH=80 PAGER="wc -l" man xargs 292
I normally use xargs for simple things and if it’s a regular business operation I’d setup a task queue but there’s a fair amount of work in the middle where it’s nice to have a solid tool with most of the features you could want built in and tested.
You might want to look at:
https://unix.stackexchange.com/questions/104778/gnu-parallel...
I'll say that field separation / null termination is a bit annoying for xargs/find etc-but more so perhaps for novice users of shell. I do like shell pipelines, but quoting can be nearly.