From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Otlhn-0007xs-9W for garchives@archives.gentoo.org; Thu, 09 Sep 2010 18:18:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6697EE09F6; Thu, 9 Sep 2010 18:18:17 +0000 (UTC) Received: from dcnode-01.unlimitedmail.net (smtp.unlimitedmail.net [94.127.184.242]) by pigeon.gentoo.org (Postfix) with ESMTP id 09272E09F6 for ; Thu, 9 Sep 2010 18:18:16 +0000 (UTC) Received: from scooter.muppet.show (hex.aaisp.net.uk [90.155.53.9] (may be forged)) (authenticated bits=0) by dcnode-01.unlimitedmail.net (8.14.3/8.14.3) with ESMTP id o89II71K001392 for ; Thu, 9 Sep 2010 20:18:07 +0200 Date: Thu, 9 Sep 2010 19:03:55 +0100 From: Etaoin Shrdlu To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Pipe Lines - A really basic question Message-ID: <20100909190355.4c6fbd74@scooter.muppet.show> In-Reply-To: References: X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SOLTECSIS-MailScanner-ID: o89II71K001392 X-SOLTECSIS-MailScanner-From: shrdlu@unlimitedmail.org X-Spam-Status: No X-Archives-Salt: e050a36e-ff0b-4617-a1fa-71b98671f901 X-Archives-Hash: 28465b230ca65772846880f72d6b5cf3 On Thu, 9 Sep 2010 13:24:16 -0400 Matt Neimeyer wrote: > My generic question is: When I'm using a pipe line series of commands > do I use up more/less space than doing things in sequence? > > For example, I have a development Gentoo VM that has a hard drive that > is too small... I wanted to move a database off of that onto another > machine but when I tried the following I filled my partition and 'evil > things' happened... > > mysqldump blah... > gzip blah... > > In this specific case I added another virtual drive, mounted that and > went on with life but I'm curious if I could have gotten away with the > pipe line instead. Will doing something like this still use "twice" > the space? > > mysqldump | gzip > file.sql.gz > > OR going back to my generic question if I pipe line like "type | sort > | unique > output" does that only use 1x or 3x the disk space? > > Thanks in advance! > > Matt > > P.S. If the answer is "it depends" how do know what it depends on? Pipes live in memory and do not take any disk space. Doing the same operations one after another instead of using pipes instead usually needs temporary file, which *do* take disk space.