linux

How to List the contents of a tar or tar.gz file

Task: List the contents of a tar file Use the following command: $ tar -tvf file.tar Task: List the contents of a tar.gz file Use the following command: $ tar -ztvf file.tar.gz Task: List the contents of a tar.bz2 file Use the following command: $ tar -jtvf file.tar.bz2 Where, t: List the contents of an […]

linux

How to extract gz, tar.gz and .tgz file?

How do I extract a gz file? Use guzip command as follows: $ gunzip file.gz OR $ 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 […]