[olug] Nesting commands at command line

Trent Melcher tmelcher at trilogytel.com
Mon Aug 4 15:19:44 UTC 2003

If you dont know where the file is, or if its in alot of places you can
always try

find / | grep bad_file

this will find bad_file anywhere on you system.  Note: it will find it on
remotely mounted drives too.

Then you could run a little shell script

for i in `find / | grep bad_file`; do echo " Removing $i"; rm $i; done

-----Original Message-----
From: olug-bounces at olug.org [mailto:olug-bounces at olug.org]On Behalf Of
Craig Wolf
Sent: Monday, August 04, 2003 9:54 AM
To: olug at olug.org
Subject: [olug] Nesting commands at command line

I am not finding the answer at google probably because I am not searching on
the right terms.  I need to pipe a multiline output as the input to another
command and I can't remember/find the answer to do it.
I need to find a file in all locations: find /var/www -name bad_file
I then need to remove those files.

Any and all help appreciated!

Craig Wolf
Linux Web Server Support
Backup Supervisor
Desktop/Network Specialist

OLUG mailing list
OLUG at olug.org

More information about the OLUG mailing list