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

  • <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命令使用實(shí)例

      Linux Grep命令使用實(shí)例

      時(shí)間: 志藝942 分享

      Linux Grep命令使用實(shí)例

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

        Linux Grep命令使用實(shí)例

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

        首先建一個(gè)demo_file:

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

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

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

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

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

        例03:忽略大小寫(xiě)使用 grep -i

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

        例04:在文件中匹配正則表達(dá)式

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

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

        從Grep文檔的來(lái)看,一個(gè)正則表達(dá)式必須遵循下面的匹配操作。

        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命令使用實(shí)例”還想看:

      1.14個(gè)grep命令使用例子介紹

      2.15個(gè)Linux Grep命令使用實(shí)例

      3.linux ls命令的實(shí)用范例

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

      2991106