Back to articles
Bash Essential Aliases and Functions
NewsTools

Bash Essential Aliases and Functions

via Dev.toAsaduzzaman Pavel

I used to maintain a .bashrc file with 200+ aliases I copied from various dotfiles repositories. I used maybe five of them. The rest were performance theater - shortcuts for commands I ran once a month, if ever. Good aliases remove friction from paths you actually walk multiple times per day. These are the ones that survived my periodic purges, plus a few functions that solve specific annoyances I kept running into. Navigation Shortcuts The .. family is worth mentioning: # filename: ~/.bashrc alias .. = 'cd ..' alias ... = 'cd ../..' alias .... = 'cd ../../..' I also keep this for jumping back to the last directory: # filename: ~/.bashrc alias - = 'cd -' I used to alias cd to something fancier, like zoxide or autojump . The problem is that cd is muscle memory. Every time I typed cd on a remote server where my aliases don't exist, I felt the cognitive overhead. Now I leave cd alone and use z explicitly when I need fuzzy directory jumping. Git Shortcuts That Don't Hide Too Much I write a

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles