Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sfsup.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxm!sftig!sfsup!mjs From: mjs@sfsup.UUCP (M.J.Shannon) Newsgroups: net.unix,net.unix-wizards,net.wanted Subject: Re: Need unix command file HELP! Message-ID: <135@sfsup.UUCP> Date: Mon, 17-Feb-86 18:25:19 EST Article-I.D.: sfsup.135 Posted: Mon Feb 17 18:25:19 1986 Date-Received: Tue, 18-Feb-86 04:18:11 EST References: <245@aero.ARPA> <587@smeagol.UUCP> <259@hadron.UUCP> <1320@utai.UUCP> Organization: AT&T Information Systems, Summit N.J. Lines: 26 Xref: watmath net.unix:7122 net.unix-wizards:16813 net.wanted:8189 > >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