Last active
October 27, 2022 13:19
-
-
Save mjpost/3167f6bd0e5bb38f3419554b129d22b4 to your computer and use it in GitHub Desktop.
Command line use of GNU parallel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I can never remember syntax for GNU parallel | |
## Treat STDIN as a pool of commands to run, running the command for each, at most j in parallel | |
cat commands.txt | parallel -j 10 | |
## Download a long list of files in parallel | |
cat files.txt | parallel -j 10 wget -q {} | |
## Start 10 parallel instances of COMMAND with FLAGS. Feed STDIN in 10k blocks to these commands. Assemble the outputs in order (-k). | |
cat large_input.txt | parallel -j 10 --pipe -k --block-size 10m COMMAND FLAGS > output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment