Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.PCS 1/10/84; site mtuxo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!hfavr From: hfavr@mtuxo.UUCP (a.reed) Newsgroups: net.unix,net.unix-wizards,net.wanted Subject: Re: Need unix command file HELP! Message-ID: <1287@mtuxo.UUCP> Date: Mon, 3-Feb-86 19:45:39 EST Article-I.D.: mtuxo.1287 Posted: Mon Feb 3 19:45:39 1986 Date-Received: Wed, 5-Feb-86 01:49:43 EST References: <245@aero.ARPA> Organization: AT&T Information Systems Labs, Holmdel NJ Lines: 25 Xref: watmath net.unix:7006 net.unix-wizards:16648 net.wanted:8072 > We are looking for a utility that can, when given a arbitrary string, > can locate all occurences of that string anywhere on the system. Our > local Un*x gurus can't figure this out, so we are appealing to those out > in Netland to help us out. > We are looking for the command to work like this: > > findstring this-is-the-string > > The utility would return all the files (and their pathnames from the > root) to the screen. Of course if the protections on the file indicate > that the file cannot be read, the program should ignore that file and keep > on going. We think it can be done using a command file using the 'ls' > and 'awk' commands but we just can get it right. > Please send source code (or ideas on writing this code) to us and we > will post to net a summary of working code. > Thanks in advance. > > sutton@aerospace.ARPA > {ihnp4!sdcrdcf,randvax,trwrb} ! aero ! sutton > sutton%aerospace.ARPA@WISCVM.BITNET # In ksh or sh this is a one-liner: 2>/dev/null find / -exec fgrep -l $1 {} \; # Please do not post ELEMENTARY shell questions to net.unix-wizards! # Adam Reed (ihnp4!npois!adam)