Startup Files

When you log in to a shell, it starts a new session and runs some initialization files to set up your environment. These files are known as startup files and may differ based on the shell you are using. Some common shells and their corresponding startup files are:

  • Bash: ~/.bashrc (for non-login shells) and ~/.bash_profile or ~/.bash_login or ~/.profile (for login shells)
  • Zsh: ~/.zshrc (for non-login shells) and ~/.zprofile (for login shells)
  • Fish: ~/.config/fish/config.fish

In these files, you can set environment variables, aliases, functions, and execute other commands that you want to run when you start a new shell session. For example, you may want to set the PATH environment variable to include custom directories, or define an alias to run a frequently used command with some options.

It's important to note that some of these files may not exist by default, and you may need to create them yourself. Also, if you modify these files, you may need to restart your shell or run the source command to apply the changes.

That's a brief overview of startup files in shells.

Complete and Continue