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

    Feb 16, 2016 · Recursive grep is, of course, still preferable if available, but there's little reason to avoid the xargs recipe (do use -H for the grep to avoid the final invocation of grep getting …

  2. linux - What is the point of "grep -q" - Stack Overflow

    May 16, 2019 · Here's an example of grep -q: scanning the output of a command for a particular value, then performing an action if the value is found: if docker context ls | grep -q dm …

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

    I am trying to understand the difference between grep -e and grep -E. Now from grep manpage I got:-E, --extended-regexp. Interpret PATTERN as an extended regular expression (see …

  4. What expressions would match the pattern (^[0-9]..[a-zA-Z ]+$) in …

    Nov 3, 2021 · Let's break it down. First of all, note that this RegExp uses the "Extended regular expression" syntax (ERE) - the + is a metacharacter that doesn't work in the "Basic regular …

  5. What's the difference between grep -r and -R - Stack Overflow

    Mar 31, 2014 · grep -r foobar . will only grep the files inside this directory, grep -r foobar foo will grep the files in the parent directory (..) (following the symlink given as an argument), grep -R …

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

    Nov 8, 2010 · grep -nr 'yourString*' . The dot at the end searches the current directory. Meaning for each parameter:-n Show relative line number in the file 'yourString*' String for search, …

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

    Jul 6, 2016 · grep '*abc*' file2 This one return *abc, because there is a * in the front, it matches the pattern *abc*. (3) grep '*abc*' file3 This one return *abcc because there is a * in the front and 2 …

  8. regular expression - How to run grep with multiple AND patterns?

    Mar 25, 2016 · For potentially gzip-compressed files, you can use zgrep which is generally a shell script wrapper around grep, and use one of the grep solutions above (not the ast-open one as …

  9. Counting number of lines in a file using grep and wc

    Nov 6, 2014 · You don't need grep to count the number of lines, wc is sufficient : wc -l filename should work. grep is useful only if you wan't to filter the file content, say you want to count the …

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

    Dec 1, 2011 · The grep utility looks for patterns inside files; it's irrelevant if what you care about is the file's name. Shell wildcard patterns are the way to match files by their names. In modern …

Refresh