About 1,290,000 results
Open links in new tab
  1. How to use "grep" command to find text including subdirectories

    Aug 1, 2011 · I want to find all files which contain a specific string of text. The grep command works, but I don't know how to use it for every directory (I can only do it for my current …

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

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

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

    Mar 31, 2014 · In the man page: -r Read all files under each directory, recursively, following symbolic links only if they are on the command line. what exactly does "being on the command …

  5. How can I "grep" for a filename instead of the contents of a file?

    grep is used to search within a file to see if any line matches a given regular expression. However, I have this situation - I want to write a regular expression that will match the filename itself …

  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. linux - Grep command with multiple patterns - Stack Overflow

    Dec 12, 2019 · Hi i am currently use this to grep: $ grep -nri --exclude-dir=DELIVERY_REL "xxxxxx\.h" --colour --include=*.{c,h} I am trying to fine tune the search results of my grep to …

  8. Regex (grep) for multi-line search needed - Stack Overflow

    Sep 15, 2010 · The grep you've indicated here runs forever because you have not specified any files to search at the end of the command... The '--include' is a filter of the files named and …

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

    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 ' windows ' with ' linux ' for each occurrence of …

  10. how to grep with multiple strings to find - Ask Ubuntu

    Aug 16, 2021 · 16 I understand how to use grep in the simple form: <command that spits out text> | grep "text to find" I would like to be able to grep multiple different bits of text all at once. How …