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

    Feb 16, 2016 · grep -r "texthere" . The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, . …

  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. linux - What is the point of "grep -q" - Stack Overflow

    May 16, 2019 · Moreover, this is a lot faster than a regular grep invocation, since it can exit immediately when the first match is found, rather than needing to unconditionally read (and …

  4. Using the star sign in grep - Stack Overflow

    Jul 6, 2016 · I am trying to search for the substring "abc" in a specific file in linux/bash So I do: grep '*abc*' myFile It returns nothing. But if I do: grep 'abc' myFile It returns matches correctly. …

  5. 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 …

  6. 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 …

  7. Find all files containing a specific text (string) on Linux

    Jun 6, 2013 · How do I find all files containing a specific string of text within their file contents? The following doesn't work. It seems to display every single file in the system. find / -type f …

  8. Negative matching using grep (match lines that do not contain foo ...

    How do I match all lines not matching a particular pattern using grep? I tried this: grep '[^foo]'

  9. How do I fetch lines before/after the grep result in bash?

    Sep 16, 2012 · The second grep command. "grep -oP", finds the matching string and prints everything after it until it reaches the end of the current line, while excluding the matching string.

  10. 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 …