Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there a way to extract files of tar.7z format using command line tools in Ubuntu?

share|improve this question

marked as duplicate by Rinzwind, stephenmyall, Andrea Corbellini, guntbert, bcbc Sep 5 '13 at 18:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

yes it does @guntbert See the accepted answer "7z x PACKAGE.7z that should eXtract the packages with full path." How is that not command line? – Rinzwind Sep 5 '13 at 14:31
Sorry, but the question is not a duplicate. It asks for handling tar.7z files. Neither the previous question nor its answers cover this matter. Since the answers don't address this question fully, it was legitimate to pose the question here. – tohuwawohu Sep 5 '13 at 22:36
Yes I also agree, the point of the question is the extraction of the files with a tar.7z format. – pacodelumberg Sep 6 '13 at 17:12
@Rinzwind: Please give some time before marking any post as duplicate. Since you marked it first, all copied your action. This question is for extracting .tar.7z not .7z !! I guess you know the difference.. :) – Saurav Kumar Nov 30 '13 at 4:57
@SauravKumar they are exactly the same.Linux does not care about suffixes and an extraction is based on the 1st bytes of the file. It is an identical question. And I trust stephen, andrea, guntbert enough to PM me in chat when I mess up (I have lots of examples of that :D ) – Rinzwind Nov 30 '13 at 7:24
up vote 20 down vote accepted

Yes - the package p7zip / p7zip-full provides a command-line application to zip/unzip 7z files. The command is simply 7z.

You can combine a 7z / tar call using a pipe:

7z x -so yourfile.tar.7z | tar xf - -C target_dir

where target_dir is a already-existing directory.

share|improve this answer
Who ever publishes tar.7z (lzma compression) files should learn about tar.xz/txz (lzma2), since this compression if available for tar via J parameter (like tar -cJf; not to be confused: capital J is for xz, small j is for bzip2) when xz-tools package is installed. It's also the default format on – LiveWireBT Sep 5 '13 at 11:56
People may wish to use 7zip for the strong encryption and multi-volume support. – Aaron Jan 26 '15 at 20:47
  • Install p7zip-full if not already installed:

    sudo apt-get install p7zip-full
  • execute this command to extract .tar.7z file(go to directory where is your file, if myfile.tar.7z is your file name):

    7za x myfile.tar.7z
    tar -xvf myfile.tar
  • That's it. Actually first command extracts in .tar file then next command extracts it completely.

share|improve this answer

Make sure that 7zip is installed, if not, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install p7zip

To install the command line utility do:

sudo apt-get install p7zip-full

Once done you can do the following to extract:

7z e <file_name>.tar.7z

To extract with full paths:

7z x <file_name>.tar.7z

To specify a path to extract to:

7z x <file_name>.tar.7z -o path 
share|improve this answer
7z x ghost.7z -o/home/node/ to extract to /home/node/ghost – wiak Jan 19 '15 at 1:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.