Skip to content

Instantly share code, notes, and snippets.

@A
Last active May 27, 2024 20:40
Show Gist options
  • Save A/bce19a0b6d8ac441bb57 to your computer and use it in GitHub Desktop.
Save A/bce19a0b6d8ac441bb57 to your computer and use it in GitHub Desktop.
Bash cheatsheet
# strout & stderr
## print stdout & stderr to file
cmd &> file
## pipe stdout & stderr
cmd &| less
# profile
## profile cmd
time cmd
## profile pipe
time cmd | cmd2 | cmd3 | …
# parallel
## -k - save order
## -X - emulate xargs
## the {} is replaced with each line read from standard input
cat file | parallel -k echo {} append_string
ls | parallel -X mv {} destdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment