How to extract files from MSP package

How to extract Bzip2 files with Terminal

  1. Unzip a file
  2. List the contents of a file
  3. Extract specific files and directories from the compressed file

is a command line utility that allows us to create and extract archives, and it supports the vast majority of compression programs such as,,,,, and. Those with compressed files either end with or. We can use the command to compress and extract files in and format.

Unzip a file

We use the option or followed by the option and then specify the extracted file.

It extracts the compressed file by detecting the type of compression used. We can also use the same command to extract files compressed using other algorithms.

For most Linux users, the utility is installed by default at installation time. For Windows users we have a tool called File Extraction.

If we need some information about the extraction we can use the option.

It will print the names of all extracted files in the terminal.

By default, the compressed file is extracted in the current working directory. To extract the files in a specific directory we can use the or option and specify the path to where the file should be extracted.

The compressed file in the current working directory is extracted into the directory within.

List the contents of a file

To list the contents of a file, we use the or option with the command.


It shows the entire contents of the file.

To get more details about the content like owner, file size, timestamp, we use the option or with the command.

Extract specific files and directories from the compressed file

In order to extract only certain files and directories from the compressed file, we list the names of the files and directories to be extracted after the compressed files followed by a space.

Only the files and are extracted from the compressed file.

When specifying the files, we must use the exact path for the file to be extracted as indicated by the command with the or option.

Only the directories and are extracted from the compressed file.

If we specify the file that does not exist, we will get an output saying that the file was not found.

If the file doesn't exist here, we get the following error:

Related Article - Linux Files and Directories

  • How to move files and directories on Linux with the Mv command
  • Renaming files and directories with Linux terminal