精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > Linux Grep命令使用實例

      Linux Grep命令使用實例

      時間: 志藝942 分享

      Linux Grep命令使用實例

        grep用于查找文件中符合字符串的那行。那么你知道Linux Grep命令使用實例么?接下來是小編為大家收集的Linux Grep命令使用實例,歡迎大家閱讀:

        Linux Grep命令使用實例

        Grep命令主要用于從文件中查找指定的字符串。

        首先建一個demo_file:

        復(fù)制代碼代碼如下:

        例01:從單個文件中查找指定的字符串

        復(fù)制代碼代碼如下:

        例02:從多個文件中查找指定的字符串

        復(fù)制代碼代碼如下:

        例03:忽略大小寫使用 grep -i

        復(fù)制代碼代碼如下:

        例04:在文件中匹配正則表達式

        如果你能在實際使用正則表達式,能使效率大大提高。在下面的例子中,匹配了所有以lines開頭,以empty結(jié)尾的行。

        復(fù)制代碼代碼如下:

        從Grep文檔的來看,一個正則表達式必須遵循下面的匹配操作。

        1.? The preceding item is optional and matched at most once.

        2.* The preceding item will be matched zero or more times.

        3.+ The preceding item will be matched one or more times.

        4.{n} The preceding item is matched exactly n times.

        5.{n,} The preceding item is matched n or more times.

        6.{,m} The preceding item is matched at most m times.

        7.{n,m} The preceding item is matched at least n times, but not more than m times.

        
      看了“Linux Grep命令使用實例”還想看:

      1.14個grep命令使用例子介紹

      2.15個Linux Grep命令使用實例

      3.linux ls命令的實用范例

      4.Linux下如何使用grep命令搜索多個單詞

      2991106