From the course: Linux Bash Shells and Scripts: Streamlining Tasks and Enhancing Workflows with Automation

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Bash startup

Bash startup

- [Instructor] When you first log in, you get your first Bash shell. Your shell will interpret .bash_profile or .profile from your home directory. It depends on how your Bash is configured, your system's configured which one you get. In that file, you often will add directories to your path, maybe you'll set umask to customize what permission modes are set when you create files, maybe protect yourself a little bit. And generally in your profile, you're setting things like environment variables that are to be inherited by shells and processes that come later. In your .bashrc in your home directory, you set things that you want set every time you run a shell. So new shells, like if you do the Bash command or you run a shell script within your shell, what's in .bashrc will be done. You normally don't add things to a variable like path in your .bashrc because as your shells nested, that variable will just keep growing. So variables not in .bashrc, things like aliases and functions that…

Contents