From owner-freebsd-questions Wed Aug 12 07:55:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA06400 for freebsd-questions-outgoing; Wed, 12 Aug 1998 07:55:43 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from alcatel.fr (ns.alcatel.fr [194.133.58.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA06395 for ; Wed, 12 Aug 1998 07:55:39 -0700 (PDT) (envelope-from Thierry.Herbelot@alcatel.fr) From: Thierry.Herbelot@alcatel.fr Received: from alcatel.fr (gatekeeper-ssn.alcatel.fr [155.132.180.244]) by mailgate.alcatel.fr (ALCANET/SMTP) with ESMTP id QAA08218; Wed, 12 Aug 1998 16:59:46 +0200 Received: from aifhs1.alcatel.fr (aifhs1.alcatel.fr [155.132.180.86]) by aifhs2.alcatel.fr (ALCANET/SMTP2) with ESMTP id QAA00170; Wed, 12 Aug 1998 16:46:33 +0200 (MET DST) Received: from aifhs2.alcatel.fr (localhost [127.0.0.1]) by aifhs1.alcatel.fr (8.8.8/8.8.8) with ESMTP id QAA15317; Wed, 12 Aug 1998 16:48:46 +0200 (MET DST) Received: from lune.telspace.alcatel.fr (lune.telspace.alcatel.fr [155.132.144.65]) by aifhs2.alcatel.fr (ALCANET/SMTP2) with ESMTP id QAA29403; Wed, 12 Aug 1998 16:45:18 +0200 (MET DST) Received: from telss1 (telss1.telspace.alcatel.fr [155.132.51.4]) by lune.telspace.alcatel.fr (8.7.6/8.7.3) with SMTP id QAA28158; Wed, 12 Aug 1998 16:58:27 +0200 (MET DST) Received: from telspace.alcatel.fr by telss1 (4.1/SMI-4.1) id AA16980; Wed, 12 Aug 98 16:46:39 +0200 Received: from localhost by telspace.alcatel.fr with SMTP (1.40.112.12/16.2) id AA024562893; Wed, 12 Aug 1998 16:41:33 +0200 X-Openmail-Hops: 1 Date: Wed, 12 Aug 98 16:41:26 +0200 Message-Id: In-Reply-To: <35D195D9.CD9E1460@graphnet.com> Subject: removing files Mime-Version: 1.0 To: romank@graphnet.com Cc: freebsd-questions@FreeBSD.ORG Content-Type: text/plain; charset=US-ASCII; name="removing" Content-Disposition: inline; filename="removing" Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, what about : (under csh) foreach i (`ls | grep -v la.txt | grep -v foo.sh`) rm $i end ? TfH > Hi, > > Let's say I have a directory with la.txt and foo.sh and 6 million other > files. > > Can I issue a command that says: delete everything BUT la.txt and foo.sh > > > According to man rm there's no way to do it with that one. Is there an > alternative? > > Thanks, > > Roman > -- > Roman Katsnelson > UNIX Network Engineer > Graphnet, Inc. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message