Hey my name is Bart. I would like to share with one of my bash aliases!
I really like automate every repetitive work and reduce the steps required to do a work, so in this example I'll show you how to reduce amount of pressed keys to back e.g. 3 times.
Instead of:
cd ../../..
Just write 3 signs using this alias:
..3
If you want back and see a list then just add one more dot.
In case you want to back 10 times then use ..5 twice :)
- .. is go back
- ... is go back and show a list of directories
- 5 is example amount steps to back. TIP: you can count / signs in directory
alias ..='cd ..'
alias ..1='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
alias ...='cd .. && ll'
alias ...1='cd .. && ll'
alias ...2='cd ../.. && ll'
alias ...3='cd ../../.. && ll'
alias ...4='cd ../../../.. && ll'
alias ...5='cd ../../../../.. && ll'
I hope that this alias will be useful for you too.
I have more much more interesting aliases. I just wanted to write first post with really simple example.
Let me know in the comment if you like it and if I should share with you some next aliases ideas or automate tips :)
Top comments (1)
This is such a clever trick! 🔥 I love little hacks like this that make working in the terminal smoother. Saving keystrokes might seem small, but over time, it really adds up. Definitely share more of your automation ideas—I’d love to see them!
Speaking of Bash magic, I recently wrote about sed, which is super powerful for text processing, and envsubst, a lifesaver for DevOps-style config templating. If you're into Bash tricks, I think you'd enjoy them too! Would love to hear your thoughts. 🚀
checkout my profile: dev.to/karandaid