find
find命令的功能是根据给定的路径和条件查找相关文件或目录,可以使用的参数很多,并且支持正则表达式,结合管道符后能够实现更加复杂的功能,是系统管理员和普通用户日常工作必须掌握的命令之一。 find命令通常进行的是从根目录(/)开始的全盘搜索,有别于whereis、which、locate……等等的有条件或部分文件的搜索。对于服务器负载较高的情况,建议不要在高峰时期使用find命令的模糊搜索,会相对消耗较多的系统资源。
用法:
find [路径] [参数]
示例:
-
find / -name *.conf
全盘搜索系统中所有以.conf结尾的文件 [root@linuxcool ~]# find / -name *.conf /run/tmpfiles.d/kmod.conf /etc/resolv.conf /etc/dnf/dnf.conf /etc/dnf/plugins/copr.conf /etc/dnf/plugins/debuginfo-install.conf /etc/dnf/plugins/product-id.conf /etc/dnf/plugins/subscription-manager.conf ………………省略部分输出信息………………
分类: 文件管理