An alias in the terminal is nothing but a shortcut to commands. The alias command allows the user to launch any command or group of commands by entering a single word.
You can cut down typing time with these aliases, work smartly, and increase productivity at the command prompt.
What are some of the commands you use aliases for?
Top comments (20)
If you are using Bash you can automate creating your aliases you have for:
...='cd ../..'
etc...
by looping a range of numbers (of your choice, of course) to create each alias in sequence:
In this way you can set more than just a few aliases of this sort and go back as many as 20 directories (or more, of course). Seems pointless or redundant to some, but I find myself navigating dirs this way often lol; maybe I'm just weird. If you're not interested then I'll just remove this post...
The only reason I posted is because I already do it this way and when I seen your post here I thought you or someone else might be interested in my method.
The
...
(dot dot dot...) is genius!Damn, this is nuts! 👀😮
Massive thanks for sharing all of these 😍💯
Thanks for reminding me how lazy I am :D
alias sysup='yay -Syu --noconfirm && yay -Syu --aur --noconfirm'
alias l=k
alias g='git'
alias y='yarn'
alias yl='yarn lint --fix'
alias yt='yarn test'
alias src='cd ~/sources'
alias aliases='code ~/.zaliases'
alias cp="cp -i" # Confirm before overwriting something
alias df='df -h' # Human-readable sizes
alias free='free -m' # Show sizes in MB
alias gitu='git add . && git commit && git push'
alias deploy='yarn lint --fix && yarn deploy'
Some useful and often used commands there 😉
Thanks for the input 👍
I don't use them. In before, I used some for git (e.g.
git ci = git commit -m
and so on), but I find it better to type everything manually, so if I do something on my server, I'm not lost because there are no aliases. It also improves my mind a bit because I have to remember things.Hey yo !
Glad the alias list I shared is helpful to a few :)
To try to keep it organised, I split aliases by concern.
This is an excerpt of my .zshrc (it's like .bashrc):
cheers
On Ubuntu operating system, I create alias named update_package and it means sudo apt-get update && sudo apt-get upgrade.
It can help me to update and upgrade packages easily on my Linux operating system.
add
alias please="sudo"
to keep it wholesome and in good taste.
I too have done this in the past - just feels more polite (and may save us during the robotic uprising)
c='clear'
if you're lazy like me, CTRL+L