bash的配置文件:
1、全局配置
/etc/profile, /etc/profile.d/*.sh, /etc/bashrc
2、非全局配置(个人配置)
~/.bash_profile, ~/.bashrc
profile类的文件:
设定环境变量
运行命令或者脚本
bashrc类文件:
设定本地变量
定义命令别名
登录式shell:
正常通过某终端登陆
su - UNSERNAME
su -l USERNAME
非登录式shell:
su USERNAME
图形界面下打开的命令终端
自动执行的shell脚本
登录式shell读取文件顺序:
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
非登录式shell读取顺序:
~/.bashrc --> /etc/bashrc --> /etc/profile.d/*.sh
umask 遮罩码 定义文件或目录建立后的权限
文件:666-umask
目录:777-umask
如果不想让别人访问你的文件可设置umask为027
个人定义在 ~/.bask_profile
重新登录即可