About 1,290,000 results
Open links in new tab
  1. Using the star sign in grep - Stack Overflow

    Jul 6, 2016 · grep itself doesn't support wildcards on most platforms. You have to use egrep to use wildcards. Shells have a different syntax. "*" in the shell is <any string>. In egrep it's an …

  2. 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, . …

  3. 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 (-).

  4. linux - How to grep for the dollar symbol ($)? - Stack Overflow

    hello5 $$$ % cat temp | grep "$$$" Illegal variable name. % cat temp | grep "\$\$\$" Variable name must contain alphanumeric characters. % I want to grep for $$$ and I expect the result to be % …

  5. How to grep for lines above and below a certain pattern

    Nov 30, 2016 · Use grep with the parameters -A and -B to indicate the number a of lines A fter and B efore you want to print around your pattern: grep -A1 -B1 yourpattern file An stands for …

  6. grep - Use negate ^ to get results which not contain specified ...

    Nov 2, 2018 · The problem with using grep on filenames is that grep is a line-oriented tool, and filenames may contain newlines. Assuming that all filenames in your file are without newlines, …

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

  8. 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.

  9. grep - How do I find files that do not contain a given string …

    Nov 17, 2009 · How do I find out the files in the current directory which do not contain the word foo (using grep)?

  10. regex - How can I exclude one word with grep? - Stack Overflow

    Dec 27, 2010 · Here grep will try to list all the occurrences of 'wanted_pattern' in all the files from within currently directory and pass it to second grep to filter out the 'unwanted_pattern'. '|' - …