Skip to content

Instantly share code, notes, and snippets.

@kafkahw
Last active September 16, 2019 15:12
Show Gist options
  • Save kafkahw/97fd99b9ac80164188039b0daf711b48 to your computer and use it in GitHub Desktop.
Save kafkahw/97fd99b9ac80164188039b0daf711b48 to your computer and use it in GitHub Desktop.
Common shell commands

show history of recent commands

history

run command from history line number

!15

run command with the same arguments as the last time it was called.

!cd # this would cd into the last directory path I used.

run the last command you called

!!

clear the shell

ctrl + l

delete the line

ctrl + u

search your command line history

ctrl + r

run several commands by putting a semi-colon in between.

script/setup; script/build;

run second command only if first doesn't fail.

script/setup && script/build

run second command only if first one fails, exit code other than 0

script/build || script/fix

make the command line say something

say hello

keep your laptop from dimming or showing screensaver

caffeinate

show manual of package or tool

man npm

tldr npm

terminal browser w3m — Homebrew Formulae

w3m google.com

check server response

ping twitter.com

list of all processes that are currently running and their id.

ps -ax

stop the process that belongs to the id value you pass

kill

check the weather in your terminal

curl wttr.in/Kansas-City

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment