How to unzip files in the command line

Examples on how to extract files in the command line (Sandbox Terminal Emulator). To extract a zipped file move to the directory where the file is or use the full path to the file.

The file will be extracted to the working directory. See working directory pwd

Move to desired directory

cd /path/to/directory

To extract a .gz file

gzip -d filename.gz

To extract a .tar file

tar -xvf filename.tar

To extract a tar.gz file

tar -xzvf filename.tar.gz

To extract .zip file

unzip filename.zip

Note that extracting large files will consume memory on your IVM and space in your home disk. If zipped files are large extracting may fail or your IVM may get stuck because it used all the memory. See Managing memory in Sandbox.

Last updated