Bash multiple profiles are typically used to

Source: Internet
Author: User

Login Shells Read the following startup file:

File

Content

/etc/profile Global profiles that are open to all users
~/.bash_profile A user's personal startup file, which can be used as a personal global setting
~/.bash_login Assumptions ~/.bash_profile not found. Then bash tries to read the script
~/.profile Suppose these two files ~/.bash_profile, ~/.bash_login can not be found. Bash to take this file, this is a default file

Note:

    • Export path= $PATH:d irectory #仅仅改变当下bash的环境配置, Invalid next login
    • source. Bash_profile #改变全局变量, make it effective with source
    • . Bash_logout #退出时, the script does the operation, say emptying etc.

The Non-login shell reads the following files:

File

Content

/etc/bash.bashrc Global profiles that are open to all users
~/.bashrc A user's personal startup file, which can be used as a personal global setting

Be able to look at the. Bash_profile Script content:

#. bash_profile# Get the aliases and Functionsif [-f ~/.BASHRC]; Then. ~/.bashrcfi# User specific environment and startup Programspath= $PATH: $HOME/binexport PATH

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

Bash multiple profiles are typically used to

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.