xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux system environment All In One

Linux system environment All In One

  1. 临时环境变量,动态写入
  2. 永久环境变量,配置文件
  3. 预定义变量
  4. 位置参数

# 所有用户公用的环境变量
/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

字母减 (消掉相同的权限标识符)

  1. 创建的文件(默认不可执行,需要手动 chmod 授权)

666 减 022 等于 644
666 - 022 = 644

rw-rw-rw- 减 ----w--w- 等于 rw-r--r-- 即 644

  1. 创建的文件夹 (可以执行 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, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(94)  评论(3编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2020-10-17 如何使用 js 检测控制台被用户打开了 All In One
2020-10-17 如何禁用 Chrome Taps Group feature 💩
2020-10-17 console.warn All In One
2020-10-17 js console.log all in one
2019-10-17 git remove added file before commit
2019-10-17 scrollTop & scrollHeight & scrollTo
2019-10-17 react hooks useEffect 取消 promise
点击右上角即可分享
微信分享提示