The gpg command line man page (Gnupg) has commands for encrypting and decrypting files. Here is the standard command to encrypt / decrypt files using gpg.
gpg --encrypt --recipient xxx@mail.com ~/xxx/xxx.txt - for encryption
gpg --encrypt --recipient xxx@mail.com ~/xxx/xxx.txt
gpg --output ~/xxx/xxx.txt --decrypt ~/xxx/xxx.gpg - for decryption
gpg --output ~/xxx/xxx.txt --decrypt ~/xxx/xxx.gpg
But if I have a folder with several files and folders, how can I encrypt it using the command line?
Solution 1:
Use gpg-zip.
Encrypt the contents of the mydocs directory for user Bob to test1:
gpg-zip --encrypt --output test1 --gpg-args -r Bob mydocs
List the contents of the test1 archive:
gpg-zip --list-archive test1
. , .
2:
, . :
tar czf myfiles.tar.gz mydirectory/
'myfiles.tar.gz', /. :
tar xzf myfiles.tar.gz
berkeley encrypting, .
: gnu gpg man
cd
: $ls | gpg --multifile --encrypt $ls | gpg --multifile --encrypt $ls | gpg --encrypt-files $ls | gpg --encrypt-files
$ls | gpg --multifile --encrypt
$ls | gpg --encrypt-files
: $ls | gpg --multifile --decrypt $ls | gpg --multifile --decrypt $ls | gpg --decrypt-files $ls | gpg --decrypt-files
$ls | gpg --multifile --decrypt
$ls | gpg --decrypt-files
gpgtar - . gpgtar . gpg-ized tar, , PGP PGP Zip.
gnupg MacOS Linux.
Encrypt directory
gpgtar --encrypt --output <out_file_name> -r <recipient> <dir_name>
Decrypt Directory
gpgtar --decrypt <out_file_name>
Gpgtar man page