DEV Community

loading...

4 Aliases I Always Put on .zshrc/.bashrc

Koji (he/him)
Never lose curiosity Software Engineer in NYC/Research Resident@NYU-ITP18-19 Mostly I work with typescript, javascript, react, and python. code to do something weird/useless/helpful
・1 min read

I'm using a couple of machines, Mac, Ubuntu, and Raspberry Pis and all of them have at least 3 aliases. In addition, basically, I use zsh since I love oh-my-zsh.

If you are not familiar with alias, this post will be useful.
https://wpshout.com/quick-guides/make-bash-alias/

My .zshrc/.bashrc have followings.

reload

Sometimes I change settings, but I don't want to type source blah blah blah.

alias reload="source ~/.zshrc"
Enter fullscreen mode Exit fullscreen mode

h

I use this heavily, especially to check ssh destination lol

alias h="history"
Enter fullscreen mode Exit fullscreen mode

cl

Love to keep my iTerm screen clean as much as possible

alias cl="clear"
Enter fullscreen mode Exit fullscreen mode

p

Sometimes I do typo like pyhton or pythoo, so this is to run my python scripts smoothly.

alias p="python"
Enter fullscreen mode Exit fullscreen mode

I also put aliases for my python virtual env since I'm lazy.
For Ubuntu and Raspberry Pis have open which Mac uses.

Discussion (4)

Collapse
jonasbn profile image
jonasbn • Edited

Good post - my aliases are different, but same concept. For optimal history do check out my TIL on slimming history

Collapse
kojikanao profile image
Koji (he/him) Author

Nice!!!!
Thank you for sharing the info.

Collapse
programazing profile image
Christopher C. Johnson • Edited
alias update='sudo apt update && sudo apt upgrade -y'
Collapse
kojikanao profile image
Koji (he/him) Author

Oh, I should add that.

Thanks!