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

 

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM