掌握文件发现的艺术
任务
- 使用
which 命令查找 python3 可执行文件的位置。
- 利用
whereis 命令查找与 gcc 编译器相关的所有路径。
- 应用
find 命令在 /etc 目录及其子目录中搜索所有 .conf 文件。
要求
- 所有命令必须在
~/project 目录下执行。
- 对于
find 命令,你必须将输出结果重定向到 ~/project 目录下名为 config_files.txt 的文件中。
- 为每个命令配合使用适当的选项,以确保结果准确。
find 命令应仅搜索具有精确 .conf 扩展名的文件(不包括目录)。
示例
以下是你的终端输入和输出可能的样子(请注意,实际结果可能会根据系统配置而有所不同):
$ ░░░░░ ░░░░░░░
/usr/bin/python3
$ ░░░░░░░ ░░░
gcc: /usr/bin/gcc /usr/lib/gcc /usr/share/gcc /usr/share/man/man1/gcc.1.gz
$ cat ~/project/config_files.txt
/etc/adduser.conf
/etc/ca-certificates.conf
/etc/debconf.conf
/etc/deluser.conf
/etc/host.conf
/etc/ldap.conf
/etc/ld.so.conf
/etc/resolv.conf
...