UNIX系统常用命令
-name 查找文件名,含通配符*?的文件名用引号括起来
-perm 00x000 八进制文件属性
-atime n n天之前访问过的文件
-mtime n n天之间修改过的文件
-ctime n 文件的状态在n前之间修改过
-exec command 如命令的返回代码为零(找到相应的文件)则真,command必须以
\; 结果,此外在命令的执行中 {} 为查找到的文件路径名
-ok command 与exec相类似,但在执行每个命令之间要求用户确认 -print 打印当前路径名
-newer filename 如文件的最后修改日期较filename新则为真
-type c c=[b,c,d,l,p,f]文件类型
-user username 如文件的属主为username则为真
-nouser 文件属主在/etc/passwd文件中不存在
-group grouname 文件组
逻辑运算符: -a -o !
示列:
find $HOME \( -name a.out -o -name "*.o" \) -atime +7 -exec rm {} \; find . -atime 0 -print
find / .name .profile -print
find . -perm 777 -a -mtime 7 -exec chmod 755 {} \;
file
more
less
tail (tail -f filename)
head
wc
read 用于shell编程
col
pg (SYSV)
11. 编辑器
vi
ed
joe
12. 文件内容查找
grep

