About 1,190,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 directory). I tried rea...

  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 write) to the end of file.

  3. 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 line" means? T...

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

  5. 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 term "regular file" …

  6. 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 (and not the …

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

  8. 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 do I do that? …

  9. 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 include multiple …

  10. grepping using the result of previous grep - Stack Overflow

    Sep 20, 2015 · Is there a way to perform a grep based on the results of a previous grep, rather than just piping multiple greps into each other. For example, say I have the log file output below: ID 1000 xyz …