find方式:
find [搜索范围] [选项]
find /home -name hello.txt 在home目录里按照文件名查找hello.txt文件,有的就返回文件路径,没有就不返回。
find /home -user yunwei 在home目录下,查找yunwei账号创建的文件
find /home -size +200M 在home目录下,查找文件大小大于200MB的文件,+n是大于,-n是小于,n是等于。
单位有k,M,G。
locate方式(查找速度更快):
快速查找
updatedb+locate
updatedb
locate hello.txt