Need unix command file HELP!
M.J.Shannon
mjs at sfsup.UUCP
Tue Feb 18 09:25:19 AEST 1986
> >This:
> >
> >>find / -exec fgrep this-is-the-string '{}' \;
> >
> >will give a file full of lines containing this-is-the-string. Try:
> >
>
> find / -exec fgrep -l this-is-the-string '{}' \;
> --
> Geoff Loker
If your grep/egrep/fgrep doesn't support -l, then try the following:
find / -exec fgrep string '{}' /dev/null ';' |
sed -e 's/:.*//' |
sort -t/ -u
Note that this fails miserably if you have files whose names include a ':'.
--
Marty Shannon
UUCP: ihnp4!attunix!mjs
Phone: +1 (201) 522 6063
Disclaimer: I speak for no one.
"If I never loved, I never would have cried." -- Simon & Garfunkel
More information about the Comp.unix.wizards
mailing list