> 
> As far as I know, all versions of tar accept the filename "-" to mean stdin.
> Thus you can say
> 
>      bzcat kernel.tar.bz2 | tar xf -
> 
> and avoid having the intermediate uncompressed .tar file lying around.
> 
> This works with every version of tar I've ever tried, including Linux and
> SunOS.  I used to use this trick quite often on various dialects of Unix
> where tar didn't recognize the "z" flag.
> 
Some versions of tar (at least GNU 1.13.17) have the I switch for directly
operating on bz2 files:

$ tar Ixvf linux-2.4.2.tar.bz2

would unpack linux-2.4.2.tar.bz2 into the current working directory.
Let's say I download some source code and saved it in my home directory at
~/downloads/source.tar.bz2 and want it unpacked in /usr/local/src. 

$ cd /usr/local/src; sudo tar Ixvf ~/downloads/source.tar.bz2

OK I slipped sudo in there.  Sudo is a program for limited access to superuser
priviledges.  Basically it is used one command line command at a time, instead 
of su, where there is a superuser prompt.  One of the nifty features of sudo
is that it does not import root's environment, so in the commands above,
~ is /home/jakemsr.  I also like the fact that it is a single command method,
instead of a root prompt.  I once failed to check my prompt and typed rm -rf *,
thinking I was in ~/tmp, after some time passed, I looked at the line I typed
to see if I made a mistake, because this sure was taking longer than I thought
it should and it said ... nodge:/var# rm -rf * 
Ooops!

<[EMAIL PROTECTED]>



$ tar Icvf ~/kernels/linux-2.4.2.tbz2 /usr/src/linux

Reply via email to