LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 12-26-2007, 07:06 AM   #1
muazfarooqaslam
LQ Newbie
 
Registered: Dec 2007
Posts: 22

Rep: Reputation: 15
Diff between /etc/profile and ~/bash_profile


Hi guys,

I am new to linux and despite of searching alot on google still confused about following basic concepts,

1. What is the difference between /etc/.profile and ~/bash_profile? If i make changes in /etc/profile, it will be implemented system wide for all users and all shells but changes in ~/bash_profile will be specific to that specific user only, is this correct?

2. If changes are made in ~/bash_profile of a user but default shell of user is not bash then nothing will happen, correct? In other words changes in ~/bash_profile will only affect bash shell of that specific user.

3. Suppose i have a script (/tmp/abc) and i want this script to run each time a specific user login, should i add following line in his ~/bash_profile,

sh /tmp/abc

but again if the default shell of that user is not bash, then nothin will happen, right?

4. For same script (/tmp/abc), i want it to run each time any user login, should i add following line in /etc/profile,

sh /tmp/abc

is this correct?

5. What is the difference between ~/.bashrc and ~/.bash_profile?

6. For achieving point 4, can i proceed like this. Add this script to rc(x).d directory of default runlevel?

I will be really thankful to anyone who can help me with these points and this thread will certainly help alot of newbies like me.

Thanks
 
Old 12-26-2007, 07:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.profile or .bash_profile user52 Linux - Newbie 8 12-02-2006 11:48 AM
.bash_profile and /etc/profile not sourced? FogSwimmer Ubuntu 7 10-05-2006 05:45 AM
/etc/profile VERSUS /home/.bash_profile carbono Linux - Newbie 12 10-12-2005 09:23 AM
.profile & .bash_profile on $LFS cbates55 Linux - Distributions 1 01-02-2002 02:25 PM
profile, .bash_profile & ???? ChimpFace9000 Linux - General 1 07-05-2001 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration