I think process substitution is incredible helpful. Took me a few years to find out about it.
A super powerful command is xargs. Also make sure to have a look at the -I and -p flags, both really powerful.
I just used these two features as part of an article I wrote, Automate Your Mac Setup and Keep It Up to Date
Compare the output of two commands, get the result list and pass in one line to another command:
# Start a webserver, also accepts a port as optional argumentalias server='python3 -m http.server'# Copy to clipboard on Mac or Linuxalias copy="$(which pbcopy &> /dev/null &&echo pbcopy ||echo'xclip -sel clip')"# Pipe my public key to my clipboard.alias pubkey="more ~/.ssh/id_rsa.pub | copy && echo '=> Public key copied to pasteboard.'"
I think process substitution is incredible helpful. Took me a few years to find out about it.
A super powerful command is
xargs
. Also make sure to have a look at the-I
and-p
flags, both really powerful.I just used these two features as part of an article I wrote,
Automate Your Mac Setup and Keep It Up to Date
Compare the output of two commands, get the result list and pass in one line to another command:
And some aliases I like:
If you are curious which commands you use a lot, you can find out like this:
What Are Your Most Used Shell Commands?