You are not logged in.
Using find I try to display the occurrence of "cairo_xlib" in a directory.
These commands work well, with the drawback of outputting a large number of paths:
find /media/DATEN/Conky -type f -exec grep -il "cairo_xlib" {} \;find /media/DATEN/Conky -type f xargs grep -il "cairo_xlib"or with grep
grep -ilR "cairo_xlib" /media/DATEN/ConkyI only want the NUMBER of files found that contain 'cairo_xlib' (!).
Can anyone help?
Last edited by unklar (Yesterday 14:59:42)
Offline
With ripgrep
rg cairo_xlib --stats | grep 'files contained matches'and I'am sure there is a version of this that doesn't need grep.
edit: or
grep -ilR "cairo_xlib" /media/DATEN/Conky | wc -lOffline
With ripgrep
rg cairo_xlib --stats | grep 'files contained matches'and I'am sure there is a version of this that doesn't need grep.
edit: or
grep -ilR "cairo_xlib" /media/DATEN/Conky | wc -l
BINGO!
Thank you, @bronto
ripgrep is not installed, but
grep -ilR "cairo_xlib" /media/DATEN/Conky | wc -l satisfies me. ![]()
Offline
With ripgrep
rg cairo_xlib --stats | grep 'files contained matches'and I'am sure there is a version of this that doesn't need grep.
edit: or
grep -ilR "cairo_xlib" /media/DATEN/Conky | wc -l
I get different results:
2026·09·30 @ 10:56:17 /media/5/Conky
$ rg cairo_xlib --stats /media/5/Conky | grep 'files contained matches'
420 files contained matches
2026·09·30 @ 11:46:18 /media/5/Conky
$ ↑↑ 420 files vs ↓↓ 425 (THE WINNER) ↓↓
2026·09·30 @ 10:54:19 ~
$ grep -ilR "cairo_xlib" /media/5/Conky | wc -l
425So I stripped out the "wc -l" and put them in a file ...
2026·09·30 @ 11:46:37 ~
$ grep -ilR "cairo_xlib" /media/5/Conky>cairo.txtThen did a sort | removing any duplicates:
]![]()
425 is the winner
Debian 13 Beardog hosted by SoxDog
Still a Conky 1.9er at heart.
Offline
For behavior closer to grep -ilR, including hidden/ignored files, symlinks and binary files:
rg -il --hidden --no-ignore --follow --text 'cairo_xlib' /media/DATEN/Conky | wc -lai says:
--hidden — include hidden files and directories, such as .config.
--no-ignore — search files even when .gitignore, .ignore, or similar rules exclude them.
--follow — follow symbolic links and search their targets.
--text — treat binary files as text and search their contents too.
Offline
Rabbit hole getting deeper. ![]()
Debian 13 Beardog hosted by SoxDog
Still a Conky 1.9er at heart.
Offline