Linux Bash Profile File Configuration with Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-profile-file-configuration-examples/
PINTEREST
PINTEREST
INSTAGRAM

Linux bash profile is used to set some default or startup configuration about user accounts and bash. We have previously examined the .bashrc which resides in user home directory. In this tutorial we will look the /etc/profile or bash_profile. Bash_profile will effect to the whole system configuration.

Bash_Profile

Bash profile can be printed or edited like below.

Bash_Profile
Bash_Profile

Execution Sequence

There are different bash configuration files in Linux distributions. They have execution sequence and the later ones will override previous configurations if they collapses.

  • /etc/profile
  • ~/.bash_profile
  • ~/.bashrc
  • ~/.bash_login
  • ~/.profile
  • ~/.bash_logout

We can configuration what ever we want like a .bashrc file but keep in mind that this is a global file and all configuration will affect to the all user accounts.

Actually the execution starts with /etc/profile file and all other bash_profile configuration files are configured in the /etc/profile file in the given sequence. For detailed examples please look following tutorial.

Linux Bashrc File and Usage Examples

Multiple File Configuration

If we want to add detailed configuration to the bash_profile it may become messy. We can use /etc/profile.d directory to put bash_profile configuration files where all of them treated like they are in the /etc/profile and executed in a row.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-profile-file-configuration-examples/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  How To Set Path In Bash Shell Linux?