You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π Use man parallel_tutorial for an extensive guide
π Use parallel --citation in your publications if you use GNU Parallel
π’ Use {1}, {2}, etc. for multiple input sources
π Use --joblog logfile to keep a log of executed jobs
π Use --resume to resume interrupted runs
π Use --compress when transferring large amounts of data to remote hosts
π§ Use --tag to prefix each line of output with the input line
π Use --progress for a live progress update
π Use --regexp to use regular expressions in replacement strings
π Use parallel --link to process input sources in lockstep
π Example: Image Processing
#!/usr/bin/env bash# Resize all .jpg images to 50% of their original size
find . -name "*.jpg"| parallel convert {} -resize 50% {.}_resized.jpg
# Convert all .png images to .jpg in parallel, utilizing all CPU cores
parallel convert {} {.}.jpg ::: *.png
# Process images on remote servers
parallel --sshlogin user@server1,user@server2 --transfer \
"convert {} -resize 50% {.}_resized.jpg && rm {}" ::: *.jpg
# Generate thumbnails for all images, showing progress
parallel --bar "convert {} -resize 100x100^ -gravity center -extent 100x100 {}_thumb.jpg" ::: *.jpg
# Process large log file in parallel
cat large_log.txt | parallel --pipe grep 'ERROR'> errors.txt
# Parallel download of files
cat urls.txt | parallel --eta wget {}
Remember, GNU Parallel is a powerful tool. Use it responsibly and always test your commands with --dry-run before executing them on important data! ππ»