Shell, Bash, and terminal configuration files

Source: Internet
Author: User
Tags valid

Shell--command parser, also a programming language
Bash-a specific instance of the shell, zsh, bash are instances of the shell

The "Echo $SHELL" command can be used in the terminal to view the shell instance currently in use and can be switched to zsh or other shell instances through "Chsh-s/bin/zsh" .

Global profile (all in/etc/directory, etc for Environment config abbreviation):

/etc/profile (not recommended)--each user is called at logon

/ETC/BASHRC (it is recommended to set the global environment variable here, only for bash)--each user calls/etc/paths when bash is open (it is recommended to configure the Global environment variable here)--one line at a time, Additional configuration files can be appended with the PATH as follows: "Export path= $PATH: [Path1]:[path2]:[path3]......:[pathn]"

User profiles: (both in the ~/home directory)

~/.bash_profile (recommended here to configure user environment variables, only valid for bash)--called when the current user is logged on

~/.BASHRC (recommended to configure user environment variables here, only valid for bash)--called when the current user bash is open

Note: If you are using zsh or another shell instance, it is likely that it will not invoke the above-mentioned configuration files that are only valid for bash, so you can add "source ~/.bash_profile" to the ~/.ZSHRC (zsh user profile) Similar directives to make them effective.

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.