Creating your own bash alias help you to realize task faster and easier
In Ubuntu (I suppose in other distros too) there is a file in your $HOME
called .bashrc
, this file contains a piece of code as the following:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
This means, if the file .bash_aliases
exists, execute what is inside. The purpose of this file is to contain the user bash aliases.
Open a terminal and execute this:
touch ~/.bash_aliases
Open a terminal and execute:
nano ~/.bash_aliases
Write there your alias, example:
alias st='npm start'
This is a list of useful aliases which I use:
# This alias allows to use sudo with other alias
alias sudo='sudo '
# This alias open the current folder in the GUI, It works in Ubuntu, I don't know if the same
# alias works in other distros
alias open='xdg-open .'