compress tar code example

Example 1: gzip folder with tar

# gzip my-folder-name
#
# flags:
# 	z = filter the archive through gzip
# 	c = create a new archive
# 	v = verbosely list files processed
# 	f = use archive file or device ARCHIVE
#
# Example:
tar -zcvf my-filename.tar.gz my-folder-name

Example 2: how to zip with tar command

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

Example 3: how to zip with tar command

tar -czvf archive.tar.gz stuff

Example 4: tar compress

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

Example 5: archive tar

tar -czvf archive.tar.gz /usr/local/something

Tags:

Misc Example