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 .bash _ profile and .bashrc

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

Share

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

This article to share with you is about the difference between.bash_profile and.bashrc, Xiaobian think it is very practical, so share it with you to learn, I hope you can gain something after reading this article, not much to say, follow Xiaobian to see it.

/etc/profile: This file sets environment information for each user of the system and is executed when the user first logs in.

And collect shell settings from the configuration files in the/etc/profile.d directory.

/etc/bashrc: Executes this file for each user running bash shell. The file is read when the bash shell is opened.

~/.bash_profile: Each user can use this file to enter shell information for their own use, and the file is executed only once when the user logs in! By default, he sets some environment variables and executes the user's.bashrc file.

~/.bashrc: This file contains bash information specific to your bash shell and is read when logging in and every time you open a new shell.

~/.bash_logout: Executes this file every time you exit the system (exit bash shell).

In addition, the variables (global) set in/etc/profile can be applied to any user, while the variables (local) set in ~/.bashrc can only inherit the variables in/etc/profile, and they are "parent-child" relationships.

~/.bash_profile is an interactive, login entry to bash, and ~/.bashrc is an interactive, non-login entry to bash. Usually the two settings are roughly the same, so the former usually calls the latter.

The above is what is the difference between.bash_profile and.bashrc. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please 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

Servers

Wechat

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

12
Report