Download and untar on the fly


Please note that this blog has been moved.

Now it has its own domain: mynixworld.info🙂

If you want to read the latest version of this article (recommended) please click here and I open the page for you.

Many times I download an archive, extract it somewhere then remove the archive file from the disk (it’s just garbage). I have wondered if it’s possible to do everything on the fly, by one command only:

wget -O - http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.3.tar.bz2|tar -xjf -

So what I did was to download the tar.bz2 archive (wget) to the stdout file (-O -) and then, by using the Linux pipe (|), I’ve redirected the standard output and I’ve used it like an input (-) for the tar command.

About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s