[olug] Nesting commands at command line

Mike Peterson mpeterson at charles.omhcoxmail.com
Mon Aug 4 17:03:42 UTC 2003


Or you can use this also in the future.

List the files to make sure they exist.
find /var/www -name bad_file

Remove the files if they exist.
find /var/www -name bad_file -exec rm {} \;

Try to list the files to make sure they are gone.
find /var/www -name bad_file


----- Original Message ----- 
From: "Craig Wolf" <CJWolf at mpsomaha.org>
To: <olug at olug.org>
Sent: Monday, August 04, 2003 10:46 AM
Subject: RE: [olug] Nesting commands at command line


That worked WONDERFULLY!!  Thanx to my "support line" for the help!

Craig Wolf
Linux Web Server Support
Backup Supervisor
Desktop/Network Specialist
402-894-6283


>>> tmelcher at trilogytel.com 8/4/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
402-894-6283


_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug


_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug

_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug




More information about the OLUG mailing list