What is the difference between. bash_profile and. bashrc?

Source: Internet
Author: User
What is the difference between bash_profile and bashrc? etcprofile: This file sets environment information for each user in the system. when a user logs on for the first time, this file is executed and collected from the configuration file of the etcprofiled directory for shell settings etcbashrc: run bashshel for each. bash_profile and. what is the difference between bashrc and/etc/profile: This file sets the environment information for each user in the system. when the user logs on for the first time, this file is executed. and from/etc/profile. the configuration file in the d directory collects shell settings. /etc/bashrc: execute this file for every user running bash shell. when the bash shell is opened, the file is read. ~ /. Bash_profile: each user can use this file to input the shell Information dedicated to their own use. when a user logs on, this file is only executed once! By default, it sets some environment variables to execute the user's. bashrc file .~ /. Bashrc: This file contains bash information dedicated to your bash shell. This file is read when you log on and every time you open a new shell .~ /. Bash_logout: execute this file every time you exit the system (exit bash shell). In addition, the variable (global) set in/etc/profile can act on any user, and ~ The variables (local) set in/. bashrc and so on can only inherit the variables in/etc/profile. they are "parent-child" relationships .~ /. Bash_profile is interactive and login to run bash ~ /. Bashrc is the interactive non-login mode that enters bash. Generally, the two settings are roughly the same, so the former usually calls the latter.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.