Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 1.74 KB

Compress and decompress files readme.md

File metadata and controls

24 lines (17 loc) · 1.74 KB

Compress and decompress files

Compressing files using the gzip command

In the image below you can see that the command gzip was used to compress the file Cat.txt. Upon executing the command, when the directory is listed you can see that the Cat.txt file now has a .gz destination showing that the file was correctly compressed.

image

Decompressing files using the gunzip command

In the image below you see that the command gunzip was to decompress the file Cat.txt.gz. Once the command was executed we listed the contents of the directory where you can now see that the Cat.txt file no longer has the .gz destination showing that the file has been decompressed.

image

Compressed archive using the tar command

In the image below you can see that the command tar was used to create a compressed archive and compressed multiple files. image

Extract the Files from the Compressed Archive

In the image below you see that the command tar -xzvf archive.tar.gz is used to decompress the files and extract the files from the archive. -x: Extracts files from an archive. -z: Uncompresses the archive using gzip. -v: Verbose mode, shows progress in the terminal. -f archive.tar.gz: Specifies the archive file to extract from.

image