Simply try:
Preamble:
From man gpg
:
NAME
gpg - OpenPGP encryption and signing tool
...
COMMANDS
-e Encrypt data...
OPTIONS
-a Create ASCII armored output...
-r Encrypt for user id name...
Encryption for one recipient
$ gpg -aer $USER <<<"Hello world." >/tmp/file1.pgp
$ ls -l /tmp/file1.pgp
-rw-r--r-- 1 user user 533 nov 9 15:39 /tmp/file1.pgp
$ gpg -qd /tmp/file1.pgp
Hello world.
$ gpg -aer aFriendOfMine <<<"Hello world." >/tmp/file1.pgp
$ ls -l /tmp/file1.pgp
-rw-r--r-- 1 user user 533 nov 9 15:42 /tmp/file1.pgp
$ gpg -qd /tmp/file1.pgp
gpg: decryption failed: No secret key
Nota: I have aFriendOfMine
's public key, but I can't decrypt the message I crypted with his public key.
This answer your second question.
Encryption for many recievers
$ gpg -aer $USER -r aFriendOfMine <<<"Hello world." >/tmp/file1.pgp
$ ls -l /tmp/file1.pgp
-rw-r--r-- 1 user user 902 nov 9 15:43 /tmp/file1.pgp
The file is something bigger!
$ gpg -qd /tmp/file1.pgp
Hello world.
And I know aFriendOfMine
could decrypt same message too.
You could add many -r $DEST
flag on command line, but as many dests, the mail become bigger, depending on number of recipient AND keylength and algorithm of each recipient's key.
$ gpg -aer $USER -r aFriendOfMine -r alice -r bruno -r charlie -r theDude \
<<<"Hello world." >/tmp/file1.pgp
$ ls -l /tmp/file1.pgp
-rw-r--r-- 1 user user 3027 nov 9 16:26 /tmp/file1.pgp
The file is something bigger, but each recipient will be able to read them.