I prefer to add the aliases to a different file rather than the .bashrc. You can modify the .bashrc file to include the .bash_aliases file:
# Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
And then create a new file .bash_aliases in the home directory with the following or your own aliases:
#!/bin/bash # Adding custom aliases alias l='ls -lrt' alias lwc='ls -lrt | wc -l' alias la='ls -lart' alias lm='ls -lrt | more' alias lwc='ls | wc -l' alias f='find . -name $1' alias b='cd ..'
Finally, to execute the bash_aliases in your current session without having to logout and login again, execute the following command: