AIX 下的 find 命令使用

 

平常我们使用 find , -size +100M/K/G ,就可以找到相应大小的文件了。

可是 AIX 平台下,却好像不能使用,虽然执行起来不报错,但是查找出来的文件却并不是我们想要的。所以 man 了下手册

找出n 个字节大小的文件

bc 1024*1024 1048576=1Mb

find . -size +1000000c 

find . -size +1048576c

find . -size 10485760c

例如: 查找一个 800M 的大文件

find ./batch/spool -size +838860800c             --800*10485760=838860800  在/batch/spool 下

注意: 一定要看清不是文件夹,只是文件

查询所有的普通文件,并搜索"device"这个词:

find / -type f -print | xargs grep "device"

查找当前目录下所有的普通文件,并搜索DBO这个词:

find . -name *\-type f -print | xargs grep "DBO"

注意\表示转义

查询/apps/audit目录下,所有用户具有读写和执行权限的文件,并回收其他用户组的写权限:

find /apps/audit -perm -7 -print | xargs chmod o-w

./myfile: commands text

./first2: commands text

./test.sql: commands text

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

posted on 2019-04-02 19:24  天之痕羽翼  阅读(2944)  评论(0编辑  收藏  举报