# Archive
tar -czf archive_name.tar.gz target_file_or_folder
tar -czvf my_directory.tar.gz -C my_directory .
# The -C my_directory tells tar to change the current directory to my_directory,
# and then . means "add the entire current directory"
# (including hidden files and sub-directories).
# Extract
tar -xvf archive_name.tar.gz -C /home/cyberpunk/testdir/
# C - tells where to extract.
# c – create a archive file.
# x – extract a archive file.
# v – show the progress of archive file.
# f – filename of archive file.
# t – viewing content of archive file.
# j – filter archive through bzip2.
# z – filter archive through gzip.
# r – append or update files or directories to existing archive file.
# W – Verify a archive file.
# wildcards – Specify patters in unix tar command.