Linux/Shell
Table of Contents
Zsh + Oh-my-zsh + Powerlevel10k
- You can shorthand autocomplete paths inside commands, like:
cd /h/k/.s/
->cd /home/komidawi/.ssh
History search by starting fragment
Example:
1 2 3 4
nano /home/komidawi/.ssh/known_hosts nano /etc/hosts nano /h<UP>
will auto-complete into
1
nano /home/komidawi/.ssh/known_hosts
- Expand envs
$USER<TAB>
->komidawi
- Print parameters help
cat -<TAB>
1 2 3 4 5
--help -- display help and exit --number -n -- number all output lines --number-nonblank -b -- number nonempty output lines, overrides -n --show-all -A -- equivalent to -vET --show-ends -E -- display $ at end of each line
- Use
take
tomkdir
andcd
into ittake folder/subfolder/finish
- it also works with zip archives, git repos and url downloads
- Command history
Ctrl + R
- Press again for next occurrence
- Quick
cd
- You can move into folders by name of the folder without
cd
- You can move into folders by name of the folder without
- List last visited dirs
d
(shortcut fordirs -v
)
- Command parking
- Press
Ctrl + Q
to hide current command - After invoking another command, the first one comes back
- Press
- Open command in editor
Ctrl + X
,Ctrl + E
- Opens in default editor (
$EDITOR
) - Useful for long commands
- cd shortcuts
cd ....
-> moves 4 levels upcd -
-> jumps to previous path
- Extensive search
ls *.txt
-> text filesls **/*.txt
-> text files (also within subdirectories)ls **/(START)*.*
-> files starting with word STARTls **/*(END).*
-> files ending with word ENDls **/*(WORD)*.*
-> files with WORDls **/*(.)
-> search only filesls **/*(/)
-> search only folders
- Complex alias
- In general:
1 2 3
aliasname() { command $firstParam $secondParam }
- Example:
1 2 3
getaks() { az aks list -g $1 -o $2 }
- In general:
- List recently open directories
d
- Copy to clipboard (WSL2)
command | clip.exe
All Terminals
- Pretty format JSON
- Use JQ, e.g.:
cat file.json | jq
- Just colorize:
jc -c
- Use JQ, e.g.:
Nano
- Search a phrase
Ctrl + W
- Search next occurrence
Ctrl + W
F6
- Previous occurrence
Alt + Q
- Show help
F1
- Show navigation help
h
Top
- Show process tree
Shift + V
- Sort by CPU usage
Shift + P
- Sort by Memory usage
Shift + M
- Kill process
k
Man pages
- Search
/<phrase>
,Enter
- Next occurrence
n