Linux system environment All In One
- 临时环境变量,动态写入
- 永久环境变量,配置文件
- 预定义变量
- 位置参数
# 所有用户公用的环境变量
/etc/
# 仅对当前用户生效的环境变量
~/
.
(点 + 空格)等价于 source
$ . 配置文件
# . 等价于 source
$ source 配置文件
/etc/profile
$ cat /etc/profile
$ vim /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
umask
$ umask
022
权限计算规则
rwx = 4 + 2 + 1 = 7
rwxrwxrwx = 777
字母减 (消掉相同的权限标识符)
- 创建的文件(默认不可执行,需要手动 chmod 授权)
666 减 022 等于 644
666 - 022 = 644
rw-rw-rw- 减 ----w--w- 等于 rw-r--r-- 即 644
- 创建的文件夹 (可以执行 cd 命令)
777 减 022 等于 755
777 - 022 = 755
rwxrwxrwx 减 ----w--w- 等于 rwxr-xr-x 即 755
refs
https://www.imooc.com/video/7002/0
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 ️,侵权必究⚠️!