1.find 查找文件
  【 find -name 文件名 】 在当前目录及子目录中找这个文件

  shell 命令 查找命令find,grep


  【 find -iname 文件名 】 在当前目录及子目录中找这个文件,不区分大小写

  shell 命令 查找命令find,grep


  【 find -name 文件名 -type  f  】 f 表示查找普通文件      -type 查找某一类型的文件  包括  b c d f(普通文件) l s p

   【  find -name a.out -type f  】 查找文件 a.out的普通文件

          shell 命令 查找命令find,grep

 

 


2.grep 查找内容

  shell 命令 查找命令find,grep


  【grep “world” file.c 】   此方式只在当前目录中查找

  shell 命令 查找命令find,grep

  【grep -i "world" file.c】 -i 忽略大小写的查找

  shell 命令 查找命令find,grep

 


  【grep -n "world" file.c】-n 把行号也显示出来

  shell 命令 查找命令find,grep

  【 grep -R "a" 】-R 当前目录包括子目录中搜索内容

  shell 命令 查找命令find,grep

 


3.whereis 查找命令或者函数所在位置

shell 命令 查找命令find,grep

 

4.which 搜索命令所在目录

 shell 命令 查找命令find,grep

 

相关文章:

  • 2021-07-15
  • 2022-12-23
  • 2022-03-01
  • 2021-12-27
  • 2021-11-20
  • 2021-12-15
  • 2021-09-29
猜你喜欢
  • 2021-12-05
  • 2023-03-23
  • 2021-12-16
  • 2021-07-27
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案