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

    Feb 16, 2016 · If you find yourself frequently using grep to do recursive searches (especially if you manually do a lot of file/directory exlusions), you may find ack (a very programmer-friendly grep …

  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. UNIX grep command (grep -v grep) - Stack Overflow

    Apr 5, 2015 · 11 grep when used with ps -ef also outputs the grep used for filtering the output of ps -ef. grep -v grep means that do not include the grep used for filtering in the command output. You can …

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

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

  8. What's the difference between "grep -e" and "grep -E"

    Jun 16, 2013 · As you mentioned, grep -E is for extended regular expressions whereas -e is for basic regular expressions. From the man page: EDIT: As Jonathan pointed out below, grep -e "specifies …

  9. bash - How to grep, excluding some patterns? - Stack Overflow

    I'd like find lines in files with an occurrence of some pattern and an absence of some other pattern. For example, I need find all files/lines including loom except ones with gloom. So, I can find ...

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