This works for multiple occurrences per line:
grep -o string * | wc -l
More Related Contents:
- Can grep show only words that match search pattern?
- How can I grep recursively, but only in files with certain extensions?
- Grep only the first match and stop
- How can I have grep not print out ‘No such file or directory’ errors?
- Spider a Website and Return URLs Only
- How to grep with a list of words
- How to grep for two words existing on the same line? [duplicate]
- Ansible shell module returns error when grep results are empty
- How to extract all Yahoo emails from a .CSV file?
- Linux grep command with relevant values as output
- Capturing Groups From a Grep RegEx
- Fastest way to find lines of a file from another larger file in Bash
- More elegant “ps aux | grep -v grep”
- How to escape single quotes in Bash/Grep?
- Extraction of data from a simple XML file
- Checking if output of a command contains a certain string in a shell script
- How can I use grep to show just filenames on Linux? [closed]
- How does grep run so fast?
- Colorized grep — viewing the entire file with highlighted matches
- Bash, grep between two lines with specified string
- How can I find all of the distinct file extensions in a folder hierarchy?
- grep without showing path/file:line
- Parsing json and searching through it
- Extract lines between two patterns from a file [duplicate]
- Get java version number from python
- How can I use grep to find a word inside a folder?
- Why no output is shown when using grep twice?
- Grepping for exact words with UNIX
- How can I find all files containing specific text (string) on Linux?
- how do I use the grep –include option for multiple file types?