GNU parallel
GNU parallel is a command-line utility for Linux and other Unix-like operating systems which allows the user to execute shell scripts or commands in parallel. GNU parallel is free software, written by Ole Tange in Perl. It is available under the terms of GPLv3.[2] UsageThe most common usage is to replace the shell loop, for example while read x; do
do_something "$x"
done < list
to the form of cat list | parallel do_something
where the file Scripts using parallel are often easier to read than scripts using pexec. The program parallel features also
By default, parallel runs as many jobs in parallel as there are CPU cores. Examplesfind . -name "*.foo" | parallel grep bar
The above is the parallel equivalent to: find . -name "*.foo" -exec grep bar {} +
This searches in all files in the current directory and its subdirectories whose name end in find . -name "*.foo" -print0 | parallel -0 grep bar
The above command uses the null character to delimit file names. find . -name "*.foo" | parallel -X mv {} /tmp/trash
The above command expands find . -maxdepth 1 -type f -name "*.ogg" | parallel -X -r cp -v -p {} /home/media
The command above does the same as: cp -v -p *.ogg /home/media
However, the former command which uses Wikimedia Commons has media related to GNU parallel. See alsoReferences
External links |
Portal di Ensiklopedia Dunia