99网
您的当前位置:首页centos的文件管理

centos的文件管理

来源:99网

文件属性:

#查看当前目录下文件的权限
ls -l
#准备实验环境
mkdir /tmp/dir1
touch /tmp/dir1/file{1..5}
#修改为可执行文件
chmod u+x file2
#是文件属组可修改文件
chmod g+w file2
#修改所有人可执行的文件
chmod a+x file2

 chmod 755 file3

#修改文件的属主
chown sun file1
#修改文件的属组和所属用户
chown sun:lang file1
#单独修改文件属组
chown .root file1
chown :root file1
#递归修改
chown -R sun.lang dir1
#只能修改文件的属组
chgrp root file1

因篇幅问题不能全部显示,请点此查看更多更全内容