LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bashrc or bash_profile ? (https://www.linuxquestions.org/questions/linux-newbie-8/bashrc-or-bash_profile-344898/)

ARCIS_house 07-20-2005 03:13 AM

bashrc or bash_profile ?
 
Hey i using gentoo. i want when i put ls, my show command ls --color , where i must this write
alias ls = 'ls --color' right ?

xukosky 07-20-2005 04:14 AM

.bashrc is the most common place for an alias

ARCIS_house 07-21-2005 05:12 AM

i write alias ls = 'ls --color' in /etc/skel/.bashrc (gentoo) but this not work. Anywhy help :)

alienDog 07-21-2005 06:16 AM

Don't put it in /etc/skel but in your home directory. /etc/skel is a "model" for files that will be copied to every new user's home directory when users are added to the system, .bashrc won't get read from there. You can also place your alias in /etc/profile if you want it to work for all the users.

ARCIS_house 07-21-2005 06:28 AM

i put this in /etc/profile but this not work, while i don't write command source /etc/profile ?

chandru.in 07-21-2005 07:15 AM

Try putting it in ~/.bash_profile.

Some distros read this rather than ~/.bashrc.

If you want the change to affect all users try putting it in /etc/.bashrc

alienDog 07-21-2005 02:09 PM

Or just put source /etc/profile in your ~/.bashrc ;)

The thing is that /etc/profile will only get read when you login into your system (i.e. not when you for example open new terminal windows). adding the above to .bashrc will force /etc/profile to be read everytime that bash starts.


All times are GMT -5. The time now is 09:11 AM.