linux find 查找文件

1.根据名称查找某个目录下的文件/目录

例子:查找根目录下的文件名字为a.txt

find   /   -name  a.txt 

2.根据名称查找某个目录下类型为文件的a.txt [ -type f(文件)d(目录) ]

find   /   -name  a.txt  -type f 

 

 

3.查找某目录下大小为在某个范围的文件

例子:查找hive目录下 文件大小为100M至400M的文件

find hive  -type f -mtime -1 -size +100M -size -400M

-size参数说明:

-sizen[cwbkMG]

              File uses n units of space,rounding up.  The following suffixes

              can be used:

              `b'    for 512-byte blocks (this is the default if no suffix is

                     used)

              `c'    for bytes

              `w'    for two-byte words

              `k'    for Kilobytes (units of 1024 bytes)

              `M'    for Megabytes (units of 1048576 bytes)

              `G'    for Gigabytes (units of 1073741824 bytes)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值