============================================== Setting up Startup Files: .profile and .bashrc ============================================== -IAN! idallen@idallen.ca Reference: Running Linux: Chapter 4, p.106-108 All file references are to files in your home directory ($HOME) on ACADUNIX. .profile: ACADUNIX uses the Korn shell as your login shell. (The Korn shell is a Bourne-type shell similar to BASH.) The Korn shell reads ("sources") the file ".profile" only once when you first log in. You can put things in this file that need to be done exactly once at login and that are inherited by other shells: - set PATH and/or TERM - set umask - set erase character (backspace) - set your prompt PS1 (and export it: export PS1) Any aliases you define here will apply only to the Korn shell at login, not to any other shells you start. If you find that a nested shell is not inheriting PATH, TERM, or PS1, you must "export" the variable, e.g. "export PS1". The last thing you can put in the .profile file is "bash", to execute the bash shell when you first log in. .bash_profile: If you use a Linux system (e.g. RedHat, Knoppix, Floppix, etc.), your login shell is already BASH and it reads the .bash_profile file instead of .profile when you log in. As with .profile, .bash_profile is only read once by the login shell, not by any other shells you might start up after you log in. .bashrc: The BASH shell reads ("sources") .bashrc when it first starts up. Every new BASH shell reads this file. Put things in this file that don't get inherited from parent shells: - set your bash aliases Any aliases you define in .bashrc will apply only to all BASH shells, not to the original ACADUNIX login shell (a Korn shell). If you use Linux, the aliases you set in .bashrc apply to your login shell as well; since, your login shell is BASH.