About 1,340,000 results
Open links in new tab
  1. How do I recursively grep all directories and subdirectories?

    Feb 16, 2016 · If you find yourself frequently using grep to do recursive searches (especially if you manually do a lot of file/directory exlusions), you may find ack (a very programmer-friendly …

  2. What is the difference between grep -e and grep -E option?

    grep -e PATTERN unless, as stated in an earlier Answer and in the man pages, there are multiple search patterns, or to protect a pattern beginning with a hyphen (-).

  3. regex - Using the star sign in grep - Stack Overflow

    Jul 6, 2016 · grep * means "0 or more", and grep is greedy by default. Note that in grep basic regular expressions the metacharacters ?, + , { , | , ( , and ) lose their special meaning.

  4. How to run grep with multiple AND patterns? - Unix & Linux Stack …

    Mar 25, 2016 · I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence: grep pattern1 | grep pattern2 | ... So how to …

  5. Colorized grep -- viewing the entire file with highlighted matches

    I find grep 's --color=always flag to be tremendously useful. However, grep only prints lines with matches (unless you ask for context lines). Given that each line it prints has a match, the …

  6. Grep: how to add an "OR" condition? - Unix & Linux Stack Exchange

    Dec 1, 2011 · How can I introduce a conditional OR into grep? Something like, grepping a file's type for (JPEG OR JPG), and then sending only those files into the photos folder. For …

  7. How can I use grep to find a word inside a folder?

    Nov 8, 2010 · 165 grep -nr string my_directory Additional notes: this satisfies the syntax grep [options] string filename because in Unix-like systems, a directory is a kind of file (there is a …

  8. linux - How to search and replace using grep - Stack Overflow

    76 You could even do it like this: Example grep -rl 'windows' ./ | xargs sed -i 's/windows/linux/g' This will search for the string ' windows ' in all files relative to the current directory and replace …

  9. How to use sed/grep to extract text between two words?

    Nov 6, 2012 · How to use sed/grep to extract text between two words? Asked 12 years, 8 months ago Modified 1 year, 11 months ago Viewed 756k times

  10. Grep only the first match and stop - Stack Overflow

    Oct 20, 2016 · I'm searching a directory recursively using grep with the following arguments hoping to only return the first match. Unfortunately, it returns more than one -- in-fact two the …