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)