creating alias
Hi there --
I want to create an alias and my first choice is to modify the .bashrc file. However, according to the documentation there, it is recommended that I create a .bash_aliases file and add the alias there. Has anyone done it this way, and besides creating the file what else do I need to do in order to get the alias to work properly? Thanks. |
Here's an example that I use for Bash in Debian:
Code:
# echo "alias ls='ls -lha'" >> ~/.bashrc I'm not sure why the documentation recommends that you put aliases elsewhere. I've personally never done it that way, but perhaps there is a reason. |
To avoid the .bashrc becomes cluttered with so many commands, I choose (a personal choice) to put aliases in a separated file.
in ~/.bashrc: Code:
test -s ~/.alias && . ~/.alias || true Code:
alias a=alias But as I said, it is a personal choice. Putting aliases inside .bashrc as b1f30 did is just fine too. |
All times are GMT -5. The time now is 05:26 PM. |