Shell编程学习进度

来源:互联网 发布:python怎么输出中文 编辑:程序博客网 时间:2024/06/07 10:25

6/8上午

chmod [auog][+-=][rwx] file

chmod -R [XXX] file    //R表示递归 recursion


chown target_owner file

chgrp target_owner file


umask与chmod功能相反 默认数值为0022

umask 0002 //valid before close the shell


软链接

 ln -s  source_path    target_path

作用:多路径、多用户可访问唯一源数据,便于数据的维护


suid和guid

why:

赋予非拥有该文件用户某种权限,但是不与

区别:

suid 是文件具有与owner相同的权限

guid使文件具有与该文件所在的group的用户相同的权限

使用:

chmod [XXXX] file

在保证go具有x权限时可使用

chmod u+s u+g file


6/8下午

find path -name -type -mtime -atime -ctime -prune -group -nogroup   atime= access time mtime = modified time ctime = create time

find -newer file ! oldfile  时间介于file和oldfile之间的文件

find -size 10000c 10M 字节

find -size 10000 5000M 块


find + exec XXXX  {} \;

find + ok XXXX {} \;


xargs 的意义:获取find匹配的一部分文件,而不是全部文件,进行执行。避免了exec的命令长度受限和exec多线程执行导致的系统功能下降。

原创粉丝点击