How to make permanent Alias in Linux?

How to make permanent Alias in Linux?
LVL 1
aloknet21Asked:
Who is Participating?
 
0renConnect With a Mentor Commented:
i think the right file for bash should be ~/.bash_profile.
/etc/profile is global for all users.
it will ~/.bash_profile if it exists
the syntax is :
alias l='ls -l'
0
 
Kerem ERSOYPresidentCommented:
Hi,

Just add your alias commands in .bashrc file and they will be permanent and every time you log-on you'll get them back. But be careful I say .bashrc not .bash_rc ;-)

Cheers,
K.
0
 
Kerem ERSOYPresidentCommented:
Once you edit .bashrc you'll see the default aliases and a comment that reads " # user specific aliases and functions"

Cheers,
K
0
 
omarfaridCommented:
add it to /etc/profile if you want it for all users or to .profile in user home dir
0
All Courses

From novice to tech pro — start learning today.