Unix/Linux使用Find命令查找文件



Unix/Linux使用Find命令查找文件
 
寻找空的目录:
  find /path -depth -type d -empty
  www.2cto.com  
  寻找空文件:
  find /path -depth -type f -empty
 
  根据名字查找文件:
  find /path -name name_of_file
 
  根据扩展名查找文件:
  find /path -name “*.given_extension”
 
  寻找具有特定权限且特定扩展名的文件:
  find /path -name ‘*.txt’ -perm 644
 
  根据文件具有的权限属性来寻找文件:
  find /path -perm -permision_bits
  www.2cto.com  
  不知道扩展名,只使用文件名来寻找文件:
  find /path -name ‘given_name.*’
 
  寻找在24小时内修改过的文件:
  find /path -mtime n
  这里的n,0表示24小时,1表示48小时,2表示72小时。下面的n也一样。
 
  查找最近24小时内存取过的文件:
  find -atime n  www.2cto.com  
 
  根据所有者查找文件:
  find /path -user root
 
  查找删除的文件:
  find /path -name mytestfile | xargs rm
iCC Develop Center
 

相关内容

    暂无相关文章