how to extract tar.7z files from command line? [duplicate]

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


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.


  • 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.