How to tar.gz a directory or folder Command

Below example shows how to ar.gz a directory or a folder using the terminal command,

tar -czf tarfile.tar.gz dir-name/

tar -czf myDir.tar.gz /user/Desktop/myDir/
tar.gz a directory or folder

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap