≡ Menu

gnu tar

Linux / UNIX: Untar / Extract a .lzma Tar Ball

I’ve downloaded a file called file.tar.lzma tar ball from the Internet but I am not able to open tar ball. How do I open or extract a .lzma file under Linux or UNIX like operating systems using command line options?
[click to continue…]

Tar Extract a Single File(s) From a Large Tarball

Q. I’ve couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
[click to continue…]

Linux tar: /dev/st0: Cannot write: Invalid argument error and solution

Q. When I run tar command it fails with an error that read as follows:

tar: /dev/st0: Cannot write: Invalid argument

How do I fix this error under CentOS / Debian / Fedora / RHEL Linux HP server systems?
[click to continue…]

List The Contents Of a tar.bz2 Tarball File

How do I list the contents of a tar.bz2 file under Linux or UNIX-linke operating systems using a shell prompt?
[click to continue…]

UNIX / Linux Decompress tgz / tar.gz Files

Q. I’ve downloaded a file from internet in .tgz format. How do I decompress .tgz file under UNIX or Linux operating system using a shell prompt?
[click to continue…]

Linux / UNIX command to open .gz files

Q. I have download files from the Internet. Each file has .gz extension. How do I open .gz files under Linux?

A. You need to use gzip / gunzip program. It is a software application used for file compression. It is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered data compression algorithms

How do I extract a gz file?

Use guzip command as follows:
$ gunzip file.gz
$ gzip -d file.gz
To see new file, enter:
$ ls -l

How do I extract a tar.gz or .tgz file?

Files with extension tar.gz or .tgz are tar files compressed with gzip. On Unix system extract them with following command:
$ gunzip < file.tar.gz | tar xvf - $ gunzip < file.tgz | tar xvf -

If you have GNU tar (Linux system) you can use the z option directly:
$ tar xvzf file.tar.gz
$ tar xvzf file.tgz

Verify tar command tape backup under Linux or UNIX

I am using the tar command to backup data to tape. How do I verify that tape backup is in a good condition?
[click to continue…]

List the contents of a tar or tar.gz file

How do I list the contents of a tar or tar.gz file on a Linux, OS X, and Unix-like system?
[click to continue…]