-
Notifications
You must be signed in to change notification settings - Fork 0
linux bashrc vs profile
2012 edited this page Jul 20, 2020
·
2 revisions
环境变量即可设置本地设置,也可全局设置;文件名都很类似,bashrc/profile
本地环境变量设置
# ~/.bashrc: executed by bash for non-login shells.
# ~/.profile: executed by Bourne-compatible login shells.
全局环境变量设置
# /etc/bashrc
# /etc/profile
- bashrc 是在系统启动后执行
- profile 是在用户登录后执行
-
source .bashrc
用于更新修改后的 bashrc 文件,bash .profile
用于更新修改后的 profile 文件
都是设置环境变量的目的,为啥会存在两个文件呢?
区分两个文件存在的目的,要明白login shell
和non-login shell
, 字面意思已经很明确,是否需要在登录信息的命令下执行。如何判断当前 shell 是登录还是未登录,如下:
~$ echo $0
-bash # "-" is the first character. Therefore, this is a login shell.
~$ echo $0
bash # "-" is NOT the first character. This is NOT a login shell.
参考资料
JS
CSS
- float
- BFC
- position
- flex
- grid
DOM
- DOM
- how browser works
Node.js
react
- 生命周期
- setState
- hook
git
- git 基础命令
- git rebase 理解
- git bisect
- git commit
- git hook
设计模式
- 策略模式
- ...
TCP/IP 协议
- HTTP/1.x
- HTTP/2
- SSL/TLS
- TCP
- DNS
- HTTP Cache
- CORS
- http status code
linux(shell)知识点