Skip to main content
Maher Sakka's Blog
Main navigation
  • Home
  • Free Tools
    • Personal Salary Budgeting Calculator
    • Find My IP Address
    • Htpasswd Generator
  • Contact me
Language switcher
  • English
  • عربي
Breadcrumb
  1. Home
  2. Blog
  3. How To Compress and Extract TAR Files In Linux

How to compress and extract TAR files in Linux

Image
How to compress and extract TAR files in Linux

To compress a directory in Linux, you can use the tar command:

tar -zcvf file.tar.gz folder

To exclude a specific folder or files, use the –exclude= option with the folder name:

tar -zcvf file.tar.gz –exclude='temp' –exclude='node_modules' folder

To decompress a file, use the -x option:

tar -xzvf file.tar.gz

To decompress a file to a different directory, add the directory path:

tar -xzvf file.tar.gz /home/debian/destination
Tags
  • Linux
Free Tools
  • Personal Salary Budgeting Calculator
  • Find My IP Address
  • Htpasswd Generator
Related posts
  • How to know which ini configuration files are loaded with PHP
  • How to prevent search engines from indexing your staging server websites
  • How to find recently modified files in Linux
  • How to determine which Linux distribution and kernel version you are running
  • How to compress and decompress files in Linux with ZIP
Tags
  • Laravel
  • Linux
  • Drupal
  • Database
  • Tips & Tricks
  • Mobile
  • Servers
  • SEO
Recent posts
  • New Free Web Tools: IP Lookup & Htpasswd Generator
  • How to bypass the "PHP Fatal error: Allowed memory size of X bytes exhausted" error in Drush
  • How to detect tables wihtout primary key in a database
Monthly archive
  • May 2017 (2)
  • August 2018 (1)
  • October 2020 (1)
  • August 2023 (1)
  • July 2024 (2)
  • November 2024 (1)
  • July 2025 (10)
  • October 2025 (6)
  • December 2025 (1)
  • January 2026 (1)
Projects
  • elmanager.tn
  • 365mathex.com
  • vpop.tn
  • toufoula.tn
  • writethemoney.com
  • dinartunisien.com
RSS feed

mahersakka.com © 2024 
Build Your IT Skills, Grow Your Wealth with Maher Sakka