网站建设的实验心得体会,长沙做网站 必看 磐石网络,怎么找上海网站建,东营集团网站建设一、find#xff0c;查找某个文件的存放路径 find用来查找某个文件的存放位置。即你知道文件名字#xff0c;但不知道放在哪里。 使用格式#xff1a;“ find 查找路径 -name 要查找的文件名 ” 使用举例#xff1a;find /etc -name interfaces ro…一、find查找某个文件的存放路径 find用来查找某个文件的存放位置。即你知道文件名字但不知道放在哪里。 使用格式“ find 查找路径 -name 要查找的文件名 ” 使用举例find /etc -name interfaces rootubuntu:/# find /etc -name interfaces
/etc/network/interfaces
/etc/cups/interfaces
rootubuntu:/# 二、grep在众多文件中查找某个符号 这个符号有可能在一个文件里出现也可能在多个文件里出现。 使用格式“ grep -nr “要查找的符号” 文件路径 ”其中-n表示在结果中显示行号-r表示递归查找。 使用举例grep -nr include ./ rootubuntu:/home/xjh/iot/embedded_basic/rootfs# ls
rootfs.ext2 rootfsxjh rootfs_xjh tmp
rootubuntu:/home/xjh/iot/embedded_basic/rootfs# grep -nr include ./
匹配到二进制文件 ./rootfs.ext2
匹配到二进制文件 ./rootfs_xjh/bin/busybox
匹配到二进制文件 ./rootfs_xjh/lib/libpthread-2.10.1.so
匹配到二进制文件 ./rootfs_xjh/lib/libnss_files-2.10.1.so
./tmp/app.c:1:#includestdio.h
./tmp/driver_test.c:3:#include linux/module.h // module_init module_exit
./tmp/driver_test.c:4:#include linux/init.h // __init __exit
./tmp/driver_test.c:5:#include linux/fs.h
rootubuntu:/home/xjh/iot/embedded_basic/rootfs# 三、which与whereis查找应用程序命令的路径 这两个命令查找一个应用程序二进制文件的路径。 which只显示命令的路径而whereis显示路径或者man手册位置。 举例which lswhich mkdirwhich whichwhereis ls等等。 rootubuntu:/home/xjh/iot/embedded_basic/rootfs# which ls
/bin/ls
rootubuntu:/home/xjh/iot/embedded_basic/rootfs# whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz
rootubuntu:/home/xjh/iot/embedded_basic/rootfs#