Extract .7z File in Linux

Last updated on Dec 28, 2019 in Linux

A file extension .7z is a compressed file created by 7zip utility. To extract files from it, you can decompress the 7z file by typing the following command in Linux terminal:

$ 7za e myfile.7z

The e stands for extraction, and this will extract all the files to the same folder. If you want to extract the content to another target folder, you can specify the target folder as:

$ 7za e myfile.7z -o/path/to/folder

Where -o tells the 7zip to decompress the file to the folder that is defined right after the -o without any space.

If you first want to see the list of files inside the 7z file, check this article for details: See List of Files in .7z File in Linux