Skip to content

Instantly share code, notes, and snippets.

@phptek
Created September 9, 2019 01:18
Show Gist options
  • Save phptek/0764b2b41c2dee6d30ecfcac7bd93dd8 to your computer and use it in GitHub Desktop.
Save phptek/0764b2b41c2dee6d30ecfcac7bd93dd8 to your computer and use it in GitHub Desktop.
......SHORTCUT ALL THE THINGS! OR
"STUFF YOU REALLY NEVER THOUGHT YOU NEEDED TO KNOW"...
Scenario: You have multiple _separate_ instances of the same window open e.g. Firefox or Chrome
Use: "alt + ~" to switch between them
Scenario: You have typed a long command, (or a short one with a long filename) and you need to change something at the end or the beginning:
Use "Ctrl + A" to zip to the beginning of the line
Use "Ctrl + E" to zip to the end of the line
Scenario: You've just started a new terminal...but where are you exactly
HOME!
Scenario: Is program "awesome-cat" installed on my system?
#> which awesome-cat
Scenario: You're not at home, but you want to get there:
#> cd
Scenario: There's too much stuff in your terminal
"Ctrl + L" or
#> clear
Simple, yet powerful grep
Scenario: You've got a ton of branches, and you want to know if you have a particular one:
#> grep
#> grep -i
#> grep -l
#> grep -c
Scenario: You've got a ton of files, and you want to know if you have a particular one that contains a particular string:
#> find ~/ -type f | xargs grep 'Foo'
Scenario: Some of those files have spaces and non-UTF-8 characters in them
#> find ~/ -type f -print0 | xargs -0 grep 'Foo'
Scenario: You want to find how to invoke a command...
man vs Google
Other
less vs more vs cat
Shell redirection
<, >, |
Invoke programs from CLI
#> firefox
#> gedit
#> chromium-browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment