Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 3
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
5. Tuning the user environment
  


The login shell page 3 of 13


When bash started, it walked through the .bash_profile file in your home directory, running each line as though it had been typed at a bash prompt. This is called "sourcing" the file.

Bash acts somewhat differently depending on how it is started. If it is started as a "login" shell, it will act as it did above -- first sourcing the system-wide /etc/profile, and then your personal ~/.bash_profile.

There are two ways to tell bash to run as a login shell. One way is used when you first log in -- bash is started with a process name of -bash. You can see this in your process listing:


$ ps u
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
chouser    404  0.0  0.0  2508  156 tty2     S     2001   0:00 -bash

You will probably see a much longer listing, but you should have at least one COMMAND with a dash before the name of your shell, like -bash in the example above. This dash is used by the shell to determine if it's being run as a 'login' shell.


Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact