ibm.com — Adopt 10 good habits that improve your UNIX® command line efficiency -- and break away from bad usage patterns in the process. This article takes you step-by-step through several good, but too often neglected, techniques for command-line operations.
Feb 26, 2008 View in Crawl 4
nybble41Feb 27, 2008
Actually that won't work, because the parenthesis create a sub-shell. The second 'cd tmp/a/b/c' command won't have any effect on the main environment.A better way to write the command would be as follows:mkdir -p tmp/a/b/c && { gunzip -c ~/libotr-3.1.0.tar.gz | tar xv -C tmp/a/b/c -f -; }This is similar to fracai's suggestions, but doesn't assume tar can handle gzip files internally. The braces group commands without creating a sub-shell.
nailerFeb 28, 2008
I'm aware of that. But compression and archiving are so frequently used together, they count as one thing, which GNU tar handles all of.Futhermore, its a computers job to do most of the work. Why bother telling the system the time of compression used? The computer already knows that.
acolyte357Feb 29, 2008
"cygwin lets me run it on windows with great performance." no it doesn't
newwatch51Mar 3, 2008
likewise, I know i can just use < or > but I don't
lolo2007Jun 27, 2008
A few of those look really useful, but most don't seem worth knowing unless you need to use them often. In the time it takes to run man mkdir, and find that -p switch (that I forgot since I only used it once a few weeks ago) I could just do it the "bad" way.Likewise, the efficiency tips are only of real use with very very large files.<a class="user" href="http://xn--ugb6bax.xn----ymcae0df5a6fo.com/">http://xn--ugb6bax.xn----ymcae0df5a6fo.com/</a><a class="user" href="http://xn----ymcae0df5a6fo.com/">http://xn----ymcae0df5a6fo.com/</a>
gettaratNov 11, 2008
thanks for this ... its definitely a quick and dirty guide that is particularly clear.<a class="user" href="http://pyramidsofgiza.org/">http://pyramidsofgiza.org/</a>