权限管理:
r:
w:
x:
三类用户:
u:属主
g:属组
o:其它用户
chown:改变文件属主的
-R:修改目录级内部文件属组
--reference file file 设置文件属主参考那个文件
chgrp:改变文件属组
-R:修改目录级内部文件属组
--reference file file 设置文件属主参考那个文件
chmod:修改文件的权限
修改三类用户的权限:
chmod MODEL file,....
-R
--referenct=/path/to/somefile/ file....
修改某类用户或某些用户限制:
u,g,o,a
chmod 用户类别=MODE
chmod u=rwx /tmp/abc
chmod g=r,o=r /abc/
chmod go=r /abc/
修改某类的用户某位或某些位权限:
u,g,o,a
chmod 用户类别 +|-MODE file
chmod u-wx /temp/
站在用户登陆的角度来说,SHELL的类型:
登录式SHELL:
正常通常某终端登录
su - USERNAME
su -l USERNAME
非登录式SHELL:
su USERNAME
图形终端下打开 命令窗口
自动执行的shell脚本
bash的配置文件
全局配置
/etc/profile,/etc/profile.d/*.sh,、/etc/bashrc
个人配置
~/.bash_profile,~/.bashrc
profile类的文件
设定环境变量
运行命令或脚本
bashrc类的文件:
设定本地变量
定义 命令别名
登陆式shell如何读取配置文件?
/etc/profile->/etc/profile.d/*.sh-->~/.bash_profile->~./baserc-->/etc/bashrc
非登录式SHEL如何配置文件?
~/.bashrc-->/etc/basrc->/etc/profile.d/*.sh