Mac Environment Variables

来源:互联网 发布:淘宝假台湾回流紫砂壶 编辑:程序博客网 时间:2024/04/28 11:31

1. Shell types:

echo $SHELL

Typing the code above, the terminal will displays the type of shell of your operating system.

C Shell or Bourne Shell :
– C: csh, tcsh
– Bourne: bash, sh, zsh

2. Two types of env files (Public and Urs)
In /etc/, there are public envs, that’s means no matter which users login this machine, they all loading this file at beginning.

  1. /etc/profile, we do not recommend edit this file, because this is for all users.
  2. /etc/bashrc, system-level env file, public also, but for bash users only.
  3. ~/.bash_profile, user-level env file, but it will be run only one time when user login.
  4. ~/.bashrc, user-level env file, each time be run when user open a new shell.

3. Applied
Using source env-file-name to active the env file immediately.

4. Save
If there is no permission to save by using :wq, you can easily use :w !sudo tee % to save your work.

0 0
原创粉丝点击