From owner-freebsd-questions@FreeBSD.ORG Fri Oct 10 18:54:39 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2FF8106568F for ; Fri, 10 Oct 2008 18:54:39 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [76.96.30.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0178FC1A for ; Fri, 10 Oct 2008 18:54:39 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id QzmK1a0020x6nqcA26ufYa; Fri, 10 Oct 2008 18:54:39 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA12.emeryville.ca.mail.comcast.net with comcast id R6ue1a0052P6wsM8Y6ueDf; Fri, 10 Oct 2008 18:54:39 +0000 X-Authority-Analysis: v=1.0 c=1 a=TS5l45rMeooA:10 a=QycZ5dHgAAAA:8 a=WZezJ6-_PulzxzDIkSUA:9 a=iTJcF5UF6sEVrCkqAJvFfQ6RFY8A:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 40793C9419; Fri, 10 Oct 2008 11:54:38 -0700 (PDT) Date: Fri, 10 Oct 2008 11:54:38 -0700 From: Jeremy Chadwick To: Joe Tseng Message-ID: <20081010185438.GA40860@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-questions@freebsd.org Subject: Re: gzipping multiple files w/o tarring X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2008 18:54:39 -0000 On Fri, Oct 10, 2008 at 02:49:44PM -0400, Joe Tseng wrote: > > I'm sure this is easy but googling hasn't gotten me anywhere yet... I want to compress all the files in my directory that don't already have a .gz extension. I want them to be individual compressed files, not part of a single .tar.gz file. Can anyone point me to where I can find how to do this? "gzip *" will do what you want. When it encounters something that's already gzip'd, it will skip it, but will emit a warning that it's doing so. Otherwise, you could use something like: find -X . \! -name "*.tar.gz" -type f -maxdepth 1 | xargs gzip Which would do the same as "gzip *", but would ignore any files with a .tar.gz extension. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |