Unzip and Untar Those tar.gz or tar.bz2 Files in One Step
Publish date: 2024-06-16
If you are new to the world of Linux, you probably unzip your tar.gz files first, and then extract them from the tar file... at least, if you are even bothering to use the command prompt at all. It's easy to gunzip or even bunzip2 the files with a simple command-line switch.
To gunzip and untar a file in a single step, use the following—note that the z switch is the important one that tells tar to unzip it.
tar xvfz somefilename.tar.gz
To use bunzip2 to extract your tar.bz2 file in a single step, use the j switch instead.
tar xvfj somefilename.tar.bz2
Ahh, nice and simple, just the way we like it.
ncG1vNJzZmivp6x7qbvWraagnZWge6S7zGhsaWhpaHy2utmip2aapaPHqryRZpinnF2qu7Wt0Waroaejmnq1rdFmnrNln6d6ta3RZpmzal2btq2x0magp2Wfo7Juv9Oep2g%3D