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,

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

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

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!