Quantcast
Channel: Count findings of string in folders - Ask Ubuntu
Browsing latest articles
Browse All 2 View Live

Answer by mikewhatever for Count findings of string in folders

Use the -o flag: -o, --only-matching Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line. For example grep -ro "TODO" chapters/*.tex | wc -l

View Article



Count findings of string in folders

I have a folder with .tex files and want to find how many TODOs there are in all files. Currently, I'm doing this: grep -r "TODO" chapters/*.tex | wc -l This gives me each line that has (at least) one...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images