michael Asked: 2012-11-20 09:54:44 +0800 CST2012-11-20 09:54:44 +0800 CST 2012-11-20 09:54:44 +0800 CST How can I uncompress a *.7z file? 772 How can I uncompress a *.7z file in Ubuntu and keep the directory structure? 7zip 6 Answers Voted Best Answer Luis Alvarado 2012-11-20T09:59:55+08:002012-11-20T09:59:55+08:00 First install the p7zip-full package: sudo apt-get install p7zip-full With this, Nautilus should have an option to uncompress 7-Zip Files. I also recommend p7zip-rar so it also includes support for RAR files. This is assuming you want to do it via GUI with Nautilus. If not, after downloading the packages above do the following: 7z x PACKAGE.7z that should eXtract the packages with full path. rm-vanda 2015-02-19T08:57:14+08:002015-02-19T08:57:14+08:00 There is also dtrx - which is immensely useful for un-archiving anything. it stands for "Do The Right eXtraction" - and will uncompress anything without any fuss. simply: sudo apt-get install dtrx dtrx archive.tar.XX Manpage: http://manpages.ubuntu.com/manpages/trusty/en/man1/dtrx.1.html UPDATE for Ubuntu 20.04 : According to their pypi page, dtrx is not currently available in the official repos. Thus, if you cannot install this via apt, then you can still use pip3: pip3 install dtrx If you don't already have pip3 installed, you can install it with sudo apt install python3-pip user89707 2012-11-20T10:04:02+08:002012-11-20T10:04:02+08:00 Run following command in the terminal: sudo apt-get install p7zip-full p7zip-rar Or search through the ubuntu software center as 7zip and unrar and install the packages. Derlin 2017-09-12T05:31:15+08:002017-09-12T05:31:15+08:00 For ubuntu 17.04, no need for the full package, p7zip is enough: sudo apt install p7zip Then, uncompress using the -d command: p7zip -d something.7z Anno 2021-05-12T00:17:39+08:002021-05-12T00:17:39+08:00 First install the according package sudo apt install p7zip-full use x flag to extract files with full path use -o flag to set output directory 7z x <archive_name> -o{Directory} for example 7z x file.7z -o/home/michael/Documents/NewFolder Notice that there is no space between -o and the output directory. If the file was encrypted, it will automatically ask for the password. Soroosh Sorkhani 2020-07-09T13:04:03+08:002020-07-09T13:04:03+08:00 The other answers did not work for me. But this command worked fine: 7z e file.7z
First install the
p7zip-full
package:With this, Nautilus should have an option to uncompress 7-Zip Files.
I also recommend
p7zip-rar
so it also includes support for RAR files.This is assuming you want to do it via GUI with Nautilus. If not, after downloading the packages above do the following:
that should eXtract the packages with full path.
There is also
dtrx
- which is immensely useful for un-archiving anything.it stands for "Do The Right eXtraction" - and will uncompress anything without any fuss.
simply:
Manpage: http://manpages.ubuntu.com/manpages/trusty/en/man1/dtrx.1.html
UPDATE for Ubuntu 20.04 :
According to their pypi page, dtrx is not currently available in the official repos. Thus, if you cannot install this via
apt
, then you can still usepip3
:If you don't already have pip3 installed, you can install it with
Run following command in the terminal:
Or search through the ubuntu software center as 7zip and unrar and install the packages.
For ubuntu 17.04, no need for the full package,
p7zip
is enough:Then, uncompress using the
-d
command:First install the according package
sudo apt install p7zip-full
x
flag to extract files with full path-o
flag to set output directory7z x <archive_name> -o{Directory}
for example
7z x file.7z -o/home/michael/Documents/NewFolder
Notice that there is no space between
-o
and the output directory. If the file was encrypted, it will automatically ask for the password.The other answers did not work for me.
But this command worked fine: