Video Screencast Help

How to encrypt more than 1 files automatically using PGP Command Line

Created: 09 Mar 2012 • Updated: 13 Mar 2012 | 2 comments
reenif's picture
This issue has been solved. See solution.


I am new to PGP Command Line and I have installed it on a vmware. I have set up 1 client machine and 1 ftp server on another machine. I have also generated and published the proper keys between the two.

My intention is to be able to encrypt more than 1 file in a single batch script for 1 users via pgp command line and send these encrypted files to the ftp server automatically.

Is the pgp command line able to do the above? If yes, how because I can only see 1 encrypt command and this does not state if it could encrypt multiple files in 1 single command.

Thank you for your kind assistance!!

Comments 2 CommentsJump to latest comment

Julian_M's picture

Hi Reenif,

You can definetely encrypt multiple files with --encrypt parameter. Take a look at the syntax:

The usage format is:
pgp --encrypt <input> [<input2> ...] --recipient <user or
[-r <user2> ...] [options]


Encrypt to multiple recipients where keys are on the local keyring:
pgp --encrypt report.txt README.rtf -r "Bill Brown" -r "Mary
Smith" -r "Bob Smith"

Use wildcards to specify the files to encrypt: 
pgp -er "Bob Smith" *.doc

Encrypt multiple files into an archive:
pgp -er "Bob Smith" *.doc --output archive.pgp --archive

Probably you already have it, but just in case, I share this helpful admin´s guide:

write encryption commands, then email commands in a script an execute.

Please tell me if this worked

When you consider the issue resolved, please click Mark As Solution on the post that best provided the solution.

reenif's picture

I got multiple files to be encrypted and they are successfully encrypted. Thank you for that! =)

One thing I am puzzled with is, on the pgp command line product page, one of its key benefits is :

"Automate labor and time intensive encryption activities such as file server encryption and ftp file transfers. "

How does it automate ftp file transfers? I do not see a particular command to achieve this from within the pgp command line itself or have i gotten the concept wrong. Thank you!