How to create a tar file using SSH on Linux

To create a tar from a directory using SSH on Linux punch in the following command

tar -vcf backup.tar mystuff/

Where “mystuff” is a directory and backup.tar is the target compressed file.
You can also create a file called archive.tar of all the files and subdirectories in the current directory with the following command

tar -vcf backup.tar *

Note: “v” flag is for verbose mode.