tar all files in folder code example
Example 1: tar all files and subdirectories
tar -zcvf my.tar.gz path-of-directory/
Example 2: tar exclude directory
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
Example 3: command to compress folder linux
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Example 4: tar archive all files in directory
cd ..
tar czf workspace.tar.gz workspace