Make sure that you have SSH access to the remote server and the correct permissions to read or write files in the specified directories.
If prompted, enter your password for the remote server to authenticate your session.
bzip2
.tar.bz2
-J: Filter the archive through xz (for .tar.xz files).
Extracting a Tar Archive
Extracting a .tar file:
tar -xf archive.tar
Extracting a .tar.gz or .tgz file:
tar -xzf archive.tar.gz
Extracting a .tar.bz2 file:
tar -xjf archive.tar.bz2
Extracting a .tar.xz file:
tar -xJf archive.tar.xz
Example Usage
If you have a file named backup.tar.gz and you want to extract it, the command would look like this:
tar -xzf backup.tar.gz
Specifying an Extraction Directory
If you want to extract the contents to a specific directory, you can use the -C option followed by the directory path:
tar -xf archive.tar -C /path/to/extract/
For example:
tar -xzf backup.tar.gz -C /home/user/documents/
Conclusion
Make sure you have the necessary permissions to extract files in the target directory. After executing the command, if you used the verbose option (-v), you will see the list of files being extracted on the terminal.