Difference between revisions of "Parallel"
Jump to navigation
Jump to search
| Line 10: | Line 10: | ||
your_command | parallel "echo {}; your_command2 {}" | your_command | parallel "echo {}; your_command2 {}" | ||
| − | ls | parallel git -C {} [[git fetch|fetch]] | + | ls [[-d]] */ | parallel git -C {} [[git fetch|fetch]] |
| − | ls | parallel git -C {} [[git pull|pull]] | + | ls -d */ | parallel git -C {} [[git pull|pull]] |
[[parallel -j]] 12 [[--eta]] [[rsync -a]] {} /mnt/efs/myexample ::: mydest/* | [[parallel -j]] 12 [[--eta]] [[rsync -a]] {} /mnt/efs/myexample ::: mydest/* | ||
Revision as of 04:42, 27 March 2026
parallel[1] allows the user to execute shell scripts or commands in parallel.
- Installation:
brew install parallel parallel --help
Examples
aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text | parallel "echo {}; aws ec2 describe-instances --region {}"
your_command | parallel "echo {}; your_command2 {}"
ls -d */ | parallel git -C {} fetch ls -d */ | parallel git -C {} pull
parallel -j 12 --eta rsync -a {} /mnt/efs/myexample ::: mydest/*
Activities
Basic
- Execute a command in parallel by ssh in MACHINE1 and MACHINE2 using parallel
- Read stackexchange questions about gnu-parallel: https://unix.stackexchange.com/questions/tagged/gnu-parallel?tab=votes&pagesize=50
- Install parallel in macOS:
brew install parallelcan conflict withbrew install moreutils
Intermediate
- Review different parallel options such as:
--keep-orderor-kwhich keep order in the output. Do not affect order of execution. - Update all your
gitrepositories in a directory in macOS using parallel:ls | parallel git -C {} fetch
Related terms
- Parallels
forpsshparallel --citationyarn workspaces foreach --paralell- PostgreSQL parallel query
- Android parallel apps
- Parallel computing
- ansible -B, --background
- parallel --sshlogin
- pigz, gipz parallel implementation
See also
parallel,for,xargs,parallel --citation, sshloginxargs,parallel,paste,mapmoreutilsstress, stress-ng, parallel, ab- CPU, GPU, NPU, TPU, DPU, Groq, Proliant, thread (
Pthreads), processor, CPU socket, core, ARM , CPU Virtualization, Intel, AMD,nm,lscpu, AVX-512, Passthrough, CPU intensive, Graviton processor, Branch predictor, vCPU, SSE, Power, CPU cache
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
Source: https://en.wikiversity.org/wiki/Linux/Basic_commands/parallel
Advertising: