• 2022-06-26
    以下哪个命令可以搜索文件中特定字符串的内容()
    A: find
    B: file
    C: locate
    D: grep
  • D

    内容

    • 0

      已知当前目录中只有三个文件file1 file2 和file3,命令()能够从这些文件中查找包含字符串hello的行。 A: grep hello file1 file2 file3 B: grep hello file* C: grep hello file D: grep hello *

    • 1

      Linux系统中,在给定文件中查找与设定条件相符文件内容字符串的命令为: A: grep B: gzip C: find D: sort

    • 2

      下列哪个命令用于在文本文件中查找字符串 A: ls B: grep C: find D: pwd

    • 3

      以下哪条命令搜索用户的.bash_history文件以确定该用户是否使用过sudo命令? A: find /home -name "bash_history" | grep sudo B: find /home -name ".bash_history" | xargs grep sudo C: find /home/.bash_history | xargs grep sudo D: find /home -type history | xargs grep sudo

    • 4

      关于常见的查找命令,以下说法正确的是:( ) A: find命令是在硬盘中搜索,只要文件在系统中存在,就能找到 B: find命令是在内存中搜索,只要文件在系统中存在,就能找到 C: locate命令是通过后台数据库中按文件名搜索,搜索速度比find更快 D: 使用locate查找刚创建的新文件,可能查找不到