This article describes the basic use of the tar command, Special: Use the tar command to encrypt the file.
Assume that there is a folder/stuff in the current directory.
1. Pack all the files in the/stuffdirectory into A. tar file.
$ Tar-CVF stuff.tar stuff
Will get a stuff.tar File
2. Pack all the files in the/stuffdirectory into a tar.gz file (BTW: tgz = tar.gz)
$ Tar-CZF stuff.tar.gz stuff
Will get to a stuff.tar.gz File
3. view all files under the tar file (like ls)
$ Tar-tzf stuff.tar.gz
Or
$ Tar-TF stuff.tar
4. decompress the tar | tar.gz file
A> Use redirection to direct the contents of the TAR to the mout file
$ tar-tzf stuff.tar.gz> mout
B> edit the mout File, retain the content you want to decompress
C> decompress tar according to the mout file
$ tar-T mout-xzf stuff.tar.gz
of course, You can decompress it all
$ tar -xzf stuff.tar.gz
5. use tar to encrypt files
$ tar-zcvf-stuff | OpenSSL des3-salt-K secretpassword | dd OF = stuff. des3
Returns a stuff. des3 file: replace secretpassword with your password. Do not forget to
decompress the encrypted file using tar
$ dd If = stuf F. des3 | OpenSSL des3-D-K secretpassword | tar zxf-
note that the last "-" command releases all files.