find command in bash

find command

  • -type:file type
  • -name:file name
  • -mtime: File modification time-days
  • -mmin:minute
  • perm: File attributes
  • -size:File size

Examples:
1. Find /data/the directory 7days ago and is larger than the size of 100Mthe file

#查找
find /data -type f -mtime +7 -size +100M

#查找并删除
find /data -type f -mtime +7 -size +100M -exec rm -rf {
    
    } \;

2. Find files generated within 15 minutes

find /data -type f -mmin -15

Guess you like

Origin blog.csdn.net/Free_time_/article/details/107742892