Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between Linux environment variable settings / etc/profile, / etc/bashrc, ~ / .profile, ~ / .bashrc

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about the differences between Linux environment variable settings / etc/profile, / etc/bashrc, ~ / .profile, ~ / .bashrc. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Log in to the system to read:

When logging in to the system to get a shell process, there are three steps to read the environment profile:

1. First read the global environment variable profile / etc/profile, and then read the additional set documents according to its contents, such as / etc/profile.d and / etc/inputrc

two。 Then, according to different user accounts, go to their home directory to read ~ / .profile. If this cannot read ~ / .bash_login, it will read ~ / .profile only if it cannot be read. The settings of these three documents are basically the same, and there is a priority for reading.

3. Then read ~ / .bashrc according to the user's account number

/ etc/* and ~ /. * difference:

/ etc/profile,/etc/bashrc is the system global environment variable setting

~ / .profile, ~ / .bashrc is the setting of private environment variables in the user's home directory.

The difference between ~ / .profile and ~ / .bashrc:

All have the function of personalized customization.

~ / .profile can set the user-specific path, environment variables, etc., which is executed only once when logging in.

~ / .bashrc is also a user-specific configuration document. You can set paths and command aliases, and use it once for every execution of shell script.

The above is the difference between setting / etc/profile, / etc/bashrc, ~ / .profile and ~ / .bashrc for the Linux environment variables shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report