文件查找工具find命令总结
一、简介 find是一个文件查找工具,是在系统工具上查找默认的文件,跟locate类似。 二、与locate优缺点比较 locate: 优点:查找速度快,自动更新数据库 缺点:依赖于数据库,非实时查找,结果非精确,模糊查找 find: 优点:精确匹配,实时查找 缺点:查询速度较慢 三、命令详解 1)、格式 find [options] [查找路径] [查找条件] [处理动作] 2)、查找条件 查找条件:如果不写,默认则为当前目录 -name "文件名称": 支持使用gloab(文件通配) 查找/etc目录下以fstab为文件名的文件 1 2 [root@localhost ~]# find /etc/ -name fstab /etc/fstab 查找/etc目录下以a开头的文件 1 2 3 4 5 6 7 8 9 10 11 [root@localhost ~]# find /etc/ -name "a*" /etc/autofs_ldap_auth.conf /etc/acpi /etc/acpi/actions /etc/ali...