When I download a .tar.gz file, I open it with two commands, first gunzip and then tar.
Is it possible to open it with just one command?
When I download a .tar.gz file, I open it with two commands, first gunzip and then tar.
Is it possible to open it with just one command?
tar xzf file.tar.gz
The letters are:
If you don't have gnu tar it is still possible to open the file in a single step (although technically still two commands) using a pipe
zcat file.tar.gz |tar x
The only thing that I would add is that z usually only works on gnu tar. The typical UNIX tar won't have this in my experience at least. – Jon Mar 16 at 16:19
The z option works well on my OS X v10.5 (Leopard) as well.
When it comes to memorizing, I think it´s easy to think of what you want and not just some letters.
Then you usually end up with these two commands:
Nowadays tar decompresses automatically if needed. It is enough to write:
tar xf file.tar.gz
Mnemonic: extract file