【命令:find】
☆☆查看文件☆☆
[root@localhost ~] find /-name httpd.conf ----------在系统中查找一个名为httpd.conf的文件
(绝对路径,从根目录开始查找,find命令会遍历/下所有的文件,然后打印出寻找结果)
[root@localhost ~] find /etc-name httpd.conf ----------在系统/etc中查找一个名为httpd.conf的文件
(相对路径,已知该文件是在/etc下,则用相对路径开始查找,效率高)
[root@localhost ~] find /-name *.conf ----------在系统中查找所有以.conf结尾的文件
[root@localhost ~] find /-name httpd.* ----------在系统中查找所有以httpd开头的文件
注意:可通过星号 * 来模糊匹配要叉子的文件名(想了解find的用法可用man find去获取)
-------------------------------------------------------------------------------------------------------------------------
【命令:which】
☆☆查找执行文件的绝对路径☆☆
用法:which用于从系统的path变量所定义的目录中查找可执行文件的绝对路径
[root@localhost ~] which passwd(查找passwd这个命令在系统中的绝对路径)
输出:/usr/bin/passwd
【命令:whereis】
用法:whereis不仅仅能找出二进制文件,还能找出相关的man文件
[root@localhost ~] whereis passwd