Skip to content

Shell Cheatsheet

Antoniy Chonkov edited this page Feb 4, 2020 · 2 revisions

Shell Cheatsheet

Basic

  • Ctrl+r: open fuzzy finder for history commands
  • Alt-[j,k]: go down/up in history
  • Alt-[j,k]: when the input buffer is not empty - search history for input buffer contents
  • Ctrl-t: pick a file recursively using fuzzy finder
  • Ctrl-o: open fuzzy finder for bookmarked directories
  • mark <name>: create new bookmark directory

General Aliases

  • reload!: reload zsh configuration file
  • ..: go to .. directory
  • ...: go to ../.. directory
  • ....: go to ../../.. directory
  • .....: go to ../../../.. directory
  • v <file>: open file with text editor
  • vi <file>: open file with text editor
  • e <file>: open file with text editor
  • vv: open file using recursive fuzzy finder
  • vg: open git repository file using recursive fuzzy finder (have to be in git repo)
  • rmf: rm -rf
  • md <dir>: creates directory and cd into it
  • ka: kill all
  • sdn: sudo shutdown -h now
  • sdr: sudo shutdown -r now
  • external-ip: shows the external IP address
  • wd: shows short weather report
  • wd day: shows weather report of the day
  • wd full: shows full wather report
  • wd moon: shows moon phase
  • wd <location>: shows day weather report for specified location

Git Aliases

  • g: git
  • gst: git status
  • gs: git status
  • gl: git ln
  • gr: git remotes
  • gc: git commit
  • gca: git commit -a
  • gcam: git commit -am
  • gcm: git commit -m
  • gdic: git diff --cached
  • gdi: git diff
  • gm: invokes fuzzy finder on branches and do git merge on selected brach (with confirmation)
  • gf: invokes fuzzy finder on remotes and executes git fetch on selected remote
  • gp: invokes fuzzy finder on remotes and executes git pull on selected remote
  • ga: show changed files with fuzzy finder and preview, pick all files to be added with Tab, confirm with Enter, view preview diff with Alt+e
  • gd: show changed files with fuzzy finder, inspect diff with Enter
  • glo: show git log with fuzzy finder

Tools Aliases

  • tm [session-name]: attach to the last tmux session (if name provided - attach to that session inste). If there is no session - create new one with default name.
  • yau: yay -Syua
  • yar: yay -Rns
  • sc: sudo systemctl
  • scu: systemctl --user
  • jou: sudo journalctl -b- n 200 -f
  • mdeps: mvn dependency:tree
  • mcp: mvn clean package
  • vpnup: sudo wg-quick up wg0
  • vpndown: sudo wg-quick down wg0
  • vpns: sudo wg

Plugin Management

  • zinit update: update zsh plugins
  • zinit delete <plugin>: delete zsh plugin
  • zinit cclear: clean plugin data after removal

Clone this wiki locally