Extracting Common Compressed Formats on Linux
Incase you only have access to a Terminal here is how you would deal with 10 common compressed files. (like if your on a headless raspberry pi or sshd in from somewhere else)
-
.tar.gz or .tgz (Gzip compressed tarball):
tar -xvzf file.tar.gz
-
.tar.bz2 (Bzip2 compressed tarball):
tar -xvjf file.tar.bz2
-
.tar.xz (XZ compressed tarball):
tar -xvJf file.tar.xz
-
.zip:
unzip file.zip
-
.rar:
Install
unrar
first:sudo apt install unrar
Then extract:
unrar x file.rar
-
.7z (7-Zip format):
Install
p7zip-full
first:sudo apt install p7zip-full
Then extract:
7z x file.7z
-
.gz (Single compressed file, not tarball):
gunzip file.gz
-
.bz2 (Single compressed file, not tarball):
bunzip2 file.bz2
-
.xz (Single compressed file, not tarball):
unxz file.xz
-
.Z (Compressed with
compress
):uncompress file.Z
Replace file
with the actual name of your compressed file. For .tar
formats, the options (-x
, -v
, -f
) can be combined with the respective compression type (z
for gzip, j
for bzip2, J
for xz).
No comments:
Post a Comment