Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Pipe Lines - A really basic question
Date: Thu, 09 Sep 2010 18:18:39
Message-Id: 20100909190355.4c6fbd74@scooter.muppet.show
In Reply to: [gentoo-user] Pipe Lines - A really basic question by Matt Neimeyer
1 On Thu, 9 Sep 2010 13:24:16 -0400 Matt Neimeyer <matt@××××××××.org> wrote:
2
3 > My generic question is: When I'm using a pipe line series of commands
4 > do I use up more/less space than doing things in sequence?
5 >
6 > For example, I have a development Gentoo VM that has a hard drive that
7 > is too small... I wanted to move a database off of that onto another
8 > machine but when I tried the following I filled my partition and 'evil
9 > things' happened...
10 >
11 > mysqldump blah...
12 > gzip blah...
13 >
14 > In this specific case I added another virtual drive, mounted that and
15 > went on with life but I'm curious if I could have gotten away with the
16 > pipe line instead. Will doing something like this still use "twice"
17 > the space?
18 >
19 > mysqldump | gzip > file.sql.gz
20 >
21 > OR going back to my generic question if I pipe line like "type | sort
22 > | unique > output" does that only use 1x or 3x the disk space?
23 >
24 > Thanks in advance!
25 >
26 > Matt
27 >
28 > P.S. If the answer is "it depends" how do know what it depends on?
29
30 Pipes live in memory and do not take any disk space. Doing the same
31 operations one after another instead of using pipes instead usually needs
32 temporary file, which *do* take disk space.