Tuesday, July 24, 2018

How to Compress and Extract Files Using the tar Command on Linux





Make tar.gz file
----------------------

tar -czvf db_1.tar.gz db_1

Extract tar.gz file
--------------------

tar -xzvf archive.tar.gz

Make tar file
----------------------

tar -cvf db_1.tar db_1

Extract tar file
--------------------

tar -xvf db_1.tar

See contents under tar file
---------------------------


tar -tvf db_1.tar


-c: Create an archive.
-z: Compress the archive with gzip.
-v: Display progress in the terminal while creating the archive, also known as "verbose" mode. The v is always optional in these commands, but it's helpful.
-f: Allows you to specify the filename of the archive.
-t : Display the contents (file list) of an archive.

No comments:

Post a Comment

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Oracle Database Deep Health Check Checklist

Oracle Database Deep Health Check Checklist Recommended assessment levels Level Purpose Typical scope L1 Operational health Availability, sp...