compress a folder in linux code example
Example 1: command to compress folder linux
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Example 2: how to put directory in archive bash
tar cf ostechnix.tar ostechnix/
# Here, c flag refers create new archive and f refers the file name.
Example 3: linux compress folder
tar -zcf archive-name.tar.gz foldername