How to make permanent Alias in Linux?

How to make permanent Alias in Linux?
LVL 1
aloknet21Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.