LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-20-2005, 03:13 AM   #1
ARCIS_house
Member
 
Registered: Jan 2005
Posts: 44

Rep: Reputation: 15
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 ?
 
Old 07-20-2005, 04:14 AM   #2
xukosky
Member
 
Registered: Apr 2005
Distribution: Becoming Sid
Posts: 142

Rep: Reputation: 15
.bashrc is the most common place for an alias
 
Old 07-21-2005, 05:12 AM   #3
ARCIS_house
Member
 
Registered: Jan 2005
Posts: 44

Original Poster
Rep: Reputation: 15
i write alias ls = 'ls --color' in /etc/skel/.bashrc (gentoo) but this not work. Anywhy help
 
Old 07-21-2005, 06:16 AM   #4
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
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.

Last edited by alienDog; 07-21-2005 at 06:17 AM.
 
Old 07-21-2005, 06:28 AM   #5
ARCIS_house
Member
 
Registered: Jan 2005
Posts: 44

Original Poster
Rep: Reputation: 15
i put this in /etc/profile but this not work, while i don't write command source /etc/profile ?
 
Old 07-21-2005, 07:15 AM   #6
chandru.in
Member
 
Registered: Jun 2005
Location: Bangalore, India
Distribution: Kubuntu 7.10
Posts: 165

Rep: Reputation: 30
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
 
Old 07-21-2005, 02:09 PM   #7
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bashrc vs. bash_profile mikeshn Linux - General 9 02-10-2008 01:46 PM
.bashrc .bash_profile Soulful93 Slackware 4 05-03-2005 03:02 AM
~/.bashrc, ~/.bash_profile Sinope Linux - Newbie 6 08-17-2004 02:40 AM
.bashrc or .bash_profile? statmobile Linux - Newbie 1 02-04-2004 09:08 PM
.bashrc vs .bash_profile xor3 Linux - Newbie 1 08-16-2003 12:52 PM


All times are GMT -5. The time now is 05:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration