From owner-freebsd-questions Wed Aug 12 09:17:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA20108 for freebsd-questions-outgoing; Wed, 12 Aug 1998 09:17:56 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from pau-amma.whistle.com (s205m64.whistle.com [207.76.205.64]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA20098 for ; Wed, 12 Aug 1998 09:17:50 -0700 (PDT) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.8.8/8.8.7) id JAA20878; Wed, 12 Aug 1998 09:15:43 -0700 (PDT) (envelope-from dhw) Date: Wed, 12 Aug 1998 09:15:43 -0700 (PDT) From: David Wolfskill Message-Id: <199808121615.JAA20878@pau-amma.whistle.com> To: freebsd-questions@FreeBSD.ORG, romank@graphnet.com Subject: Re: removing files In-Reply-To: <35D195D9.CD9E1460@graphnet.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Date: Wed, 12 Aug 1998 09:17:13 -0400 >From: Roman Katsnelson >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? How about rm `ls | egrep -v '^la\.txt|foo\.sh$'` ? david -- David Wolfskill UNIX System Administrator dhw@whistle.com voice: (650) 577-7158 pager: (650) 371-4621 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message