Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-28-2010, 08:27 PM
|
#1
|
Member
Registered: Apr 2010
Posts: 33
Rep:
|
Processes running while we create a new user and the user logs in
Hi, I am a starter to the linux environment. My question is when you create a user for example >useradd test , an user called test is created and during the process of user creation, a directory with username is created on the /home directory and along with it, files like .bashrc, .bash_profile, .bash_logout are created. for example take a look at the .bashrc, it runs the script bashrc located at /etc/bashrc . I would like to know what is there in the bashrc file. Since I am new to the linux, I am not able to understand the shell scripting. I would also like to know what are the other processes which run like .bashrc when a user is logged into his account.
|
|
|
04-29-2010, 12:53 PM
|
#2
|
LQ Newbie
Registered: Mar 2010
Location: India
Distribution: RHEL
Posts: 22
Rep:
|
Quote:
Originally Posted by rahulchandrak
Hi, I am a starter to the linux environment. My question is when you create a user for example >useradd test , an user called test is created and during the process of user creation, a directory with username is created on the /home directory and along with it, files like .bashrc, .bash_profile, .bash_logout are created. for example take a look at the .bashrc, it runs the script bashrc located at /etc/bashrc . I would like to know what is there in the bashrc file. Since I am new to the linux, I am not able to understand the shell scripting. I would also like to know what are the other processes which run like .bashrc when a user is logged into his account.
|
Hi Rahul,
Seems confusing at the start when ur just new to linux, but going forward u'l surely know the wonderful things u can achieve thru linux.
Coming back to the question, bashrc is a file where a user can create aliases, functions and tailor the prompt. It is used by interactive shells like 'bash'.
Checkout some useful links here :
http://tldp.org/LDP/abs/html/sample-bashrc.html
http://www.faqs.org/docs/abs/HTML/files.html
If you have done a lil bit of coding just understand the logic written in the file, youl find it ur self.
Basically when a user logs in his account these file are executed which prepare the environment for him. For example you can add interactive colors to ur prompt, change the name etc.
Hope that helps.
Regards,
Prasad.
|
|
|
05-07-2010, 11:43 PM
|
#3
|
Member
Registered: Apr 2010
Posts: 33
Original Poster
Rep:
|
thanks Prasad, I am trying to understand the scripts which are there in the URLs you have posted. I am not able to understand few words like PS1 etc.,
|
|
|
05-08-2010, 12:09 AM
|
#4
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
The files under /etc are "global", they are for every user on the system. The files under /home/<username> are for user <username>.
PS1 defines the "prompt string". When logged in at a terminal it is the string shown to the left of the cursor. It can be whatever you like but is most commonly used to show which directory you are in and, by its final character if you are root (final character #) or an ordinary user (final character $). It may also show the name of the computer which is very useful for people having terminals open on several computers at the same time.
|
|
|
All times are GMT -5. The time now is 07:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|