首页 / 资讯中心 / 文章详情

linux中find查找

linux中find查找 ★ FEATURED ARTICLE
linux常用命令find查找find 查找范围 匹配条件范围要尽量小这样查找起来才快#匹配条件-name: 按照文件的名称-type 文件类型ldf-size: 文件大小 大于/ -小于 K M G-mtime: 文件修改时间 超过/ -低于指定时间-perm: 根据权限查找/etc下所有以 .conf结尾的文件[rootlamp ~]# find /etc -name *.conf/etc/libreport/events.d/collect_dnf.conf /etc/vconsole.conf /etc/nsswitch.conf /etc/e2scrub.conf /etc/sysconfig/nftables.conf......查找大于10M的文件[rootlamp ~]# find /etc -size 10M/etc/udev/hwdb.bin查找权限为 rwxr-xr-x 的文件[rootlamp ~]# find /etc -perm 755/etc /etc/libreport /etc/libreport/workflows.d /etc/libreport/events.d /etc/libreport/plugins /etc/libreport/events /etc/xml /etc/gdbinit.d......处理动作:在找到匹配的文件之后对这些文件执行命令find指定路径 匹配条件-exec命令{}\;在找出大于60M的文件后显示出其详细信息[rootlamp ~]# find /boot -type f -size 60M -exec ls -lh {} \;-rw-------.1root root 75M3月1422:17 /boot/initramfs-0-rescue-959db6823cff41b687677128386b2c8e.img
阅读完成 · 觉得有帮助?
咨询建站