tar the complete archive solution & zip the complete

- Creating a normal tar file

tar  cvf  filename.tar  /home/file/location/need/to/compress 

c - crate      v - verbose     f - file

- Extracting a normal tar file (We can specify where to extract also mentioning the location at the end)

tar  -xvf  filename.tar

x - extract      v - verbose      f - file 

(We can specify where to extract also mentioning the location at the end)

tar  -xvf  filename.tar  /home/location/we/need/the/extracted/files

- Creating a compressed tar file

tar  cvfz  filename.tar.gz  /home/file/location/need/to/compress 

c - crate      v - verbose     f - file     z - zip     .tar.gz  - tar with gzip compression

- Extracting compressed tar file

tar  -xvfz  filename.tar.gz

- View contents of an archive without uncompressing the whole compressed archive

tar  tf  filename.tar 

t - used to view the contents      f - file

tar  tf  filename.tar.gz

t - used to view the contents      f - file

- zip/compress a directory using zip command

zip -r filename.zip directory_name

- unzip/uncompress a .zip file using zip command

unzip filename.zip

- unzip/uncompress a .zip file to a specific location

unzip fonts.zip -d /location/where/we/need/the/files/to/be/extracted/