LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Processes running while we create a new user and the user logs in (http://www.linuxquestions.org/questions/linux-from-scratch-13/processes-running-while-we-create-a-new-user-and-the-user-logs-in-804849/)

rahulchandrak 04-28-2010 07:27 PM

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.

prpednek 04-29-2010 11:53 AM

Quote:

Originally Posted by rahulchandrak (Post 3951231)
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.

rahulchandrak 05-07-2010 10:43 PM

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.,

catkin 05-07-2010 11:09 PM

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 01:09 AM.