What does grep -w do?In what section do descriptions of C data-structures go?Can't install man pages on...

Basic power tool set for Home repair and simple projects

How do I become a better writer when I hate reading?

Are there any rules for identifying what spell an opponent is casting?

Difference between sizeof(struct name_of_struct) vs sizeof(name_of_struct)?

Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?

Should I email my professor to clear up a (possibly very irrelevant) awkward misunderstanding?

What is the color associated with lukewarm?

When is the phrase "j'ai bon" used?

Using roof rails to set up hammock

Cant bend fingertip when finger is straight

Converting 3x7 to a 1x7. Is it possible with only existing parts?

Manager wants to hire me; HR does not. How to proceed?

Threading data on TimeSeries

100-doors puzzle

How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?

Can I appeal credit ding if ex-wife is responsible for paying mortgage?

newcommand with parameter blank or zero

Is it unethical to quit my job during company crisis?

Do items with curse of vanishing disappear from shulker boxes?

Improving do loop speed with IntegerQ conditions

Reflecting Telescope Blind Spot?

Having some issue with notation in a Hilbert space

Background for black and white chart

Does anyone recognize these rockets, and their location?



What does grep -w do?


In what section do descriptions of C data-structures go?Can't install man pages on minimal Centos Docker containerHow can I list all man pages that have certain text without displaying contents?What is the difference between man and --help?What does ls -alh mean?How and what style should I use when writing man pages?How can 'man' render double quotes not as doubled backtick and prime characters?rsync: Why doesn't --archive imply --recursive when --files-from=FILE is used?Looking up docs for C header files?What does C@t{++} mean in the gdb man page?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















In here grep is used with the option -w. I did man grep and grep --help to try to find what the aforementioned option does. Neither output says anything about a -w option.



What does that option do? Why does it not appear in manor --help? In case something similar happens again, where else can I check for an answer?



I am currently using Ubuntu, if that is relevant (is it?)










share|improve this question























  • My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

    – Michael Homer
    21 mins ago


















0















In here grep is used with the option -w. I did man grep and grep --help to try to find what the aforementioned option does. Neither output says anything about a -w option.



What does that option do? Why does it not appear in manor --help? In case something similar happens again, where else can I check for an answer?



I am currently using Ubuntu, if that is relevant (is it?)










share|improve this question























  • My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

    – Michael Homer
    21 mins ago














0












0








0








In here grep is used with the option -w. I did man grep and grep --help to try to find what the aforementioned option does. Neither output says anything about a -w option.



What does that option do? Why does it not appear in manor --help? In case something similar happens again, where else can I check for an answer?



I am currently using Ubuntu, if that is relevant (is it?)










share|improve this question














In here grep is used with the option -w. I did man grep and grep --help to try to find what the aforementioned option does. Neither output says anything about a -w option.



What does that option do? Why does it not appear in manor --help? In case something similar happens again, where else can I check for an answer?



I am currently using Ubuntu, if that is relevant (is it?)







man options documentation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 25 mins ago









RUBEN GONÇALO MOROUÇORUBEN GONÇALO MOROUÇO

143




143













  • My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

    – Michael Homer
    21 mins ago



















  • My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

    – Michael Homer
    21 mins ago

















My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

– Michael Homer
21 mins ago





My man page and --help (from Debian, probably older than yours) both list -w, --word-regexp force PATTERN to match only whole words. Which grep version are you using?

– Michael Homer
21 mins ago










2 Answers
2






active

oldest

votes


















0















-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.




Source: https://linux.die.net/man/1/grep






share|improve this answer































    0














    # grep --help | grep -e -w
    -w, --word-regexp force PATTERN to match only whole words
    -H, --with-filename print file name with output lines
    -L, --files-without-match print only names of FILEs with no selected lines
    -l, --files-with-matches print only names of FILEs with selected lines
    # grep PRETTY /etc/os-release
    PRETTY_NAME="Ubuntu 18.04 LTS"
    # man grep | grep -e -w -A1
    -w, --word-regexp
    Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
    must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.




    share


























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524828%2fwhat-does-grep-w-do%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0















      -w, --word-regexp
      Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
      beginning of the line, or preceded by a non-word constituent
      character. Similarly, it must be either at the end of the line or
      followed by a non-word constituent character. Word-constituent
      characters are letters, digits, and the underscore.




      Source: https://linux.die.net/man/1/grep






      share|improve this answer




























        0















        -w, --word-regexp
        Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
        beginning of the line, or preceded by a non-word constituent
        character. Similarly, it must be either at the end of the line or
        followed by a non-word constituent character. Word-constituent
        characters are letters, digits, and the underscore.




        Source: https://linux.die.net/man/1/grep






        share|improve this answer


























          0












          0








          0








          -w, --word-regexp
          Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
          beginning of the line, or preceded by a non-word constituent
          character. Similarly, it must be either at the end of the line or
          followed by a non-word constituent character. Word-constituent
          characters are letters, digits, and the underscore.




          Source: https://linux.die.net/man/1/grep






          share|improve this answer














          -w, --word-regexp
          Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the
          beginning of the line, or preceded by a non-word constituent
          character. Similarly, it must be either at the end of the line or
          followed by a non-word constituent character. Word-constituent
          characters are letters, digits, and the underscore.




          Source: https://linux.die.net/man/1/grep







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 21 mins ago









          BenjaminBenjamin

          766




          766

























              0














              # grep --help | grep -e -w
              -w, --word-regexp force PATTERN to match only whole words
              -H, --with-filename print file name with output lines
              -L, --files-without-match print only names of FILEs with no selected lines
              -l, --files-with-matches print only names of FILEs with selected lines
              # grep PRETTY /etc/os-release
              PRETTY_NAME="Ubuntu 18.04 LTS"
              # man grep | grep -e -w -A1
              -w, --word-regexp
              Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
              must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.




              share






























                0














                # grep --help | grep -e -w
                -w, --word-regexp force PATTERN to match only whole words
                -H, --with-filename print file name with output lines
                -L, --files-without-match print only names of FILEs with no selected lines
                -l, --files-with-matches print only names of FILEs with selected lines
                # grep PRETTY /etc/os-release
                PRETTY_NAME="Ubuntu 18.04 LTS"
                # man grep | grep -e -w -A1
                -w, --word-regexp
                Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
                must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.




                share




























                  0












                  0








                  0







                  # grep --help | grep -e -w
                  -w, --word-regexp force PATTERN to match only whole words
                  -H, --with-filename print file name with output lines
                  -L, --files-without-match print only names of FILEs with no selected lines
                  -l, --files-with-matches print only names of FILEs with selected lines
                  # grep PRETTY /etc/os-release
                  PRETTY_NAME="Ubuntu 18.04 LTS"
                  # man grep | grep -e -w -A1
                  -w, --word-regexp
                  Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
                  must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.




                  share















                  # grep --help | grep -e -w
                  -w, --word-regexp force PATTERN to match only whole words
                  -H, --with-filename print file name with output lines
                  -L, --files-without-match print only names of FILEs with no selected lines
                  -l, --files-with-matches print only names of FILEs with selected lines
                  # grep PRETTY /etc/os-release
                  PRETTY_NAME="Ubuntu 18.04 LTS"
                  # man grep | grep -e -w -A1
                  -w, --word-regexp
                  Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
                  must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.





                  share













                  share


                  share








                  edited 2 mins ago

























                  answered 8 mins ago









                  murumuru

                  39.6k595171




                  39.6k595171






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524828%2fwhat-does-grep-w-do%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...