good tutorial: https://www.devdungeon.com/content/gpg-tutorial
gpg --encrypt --recipient 'user@emailaddress.com' example.txt gpg --encrypt --recipient $USER example.txt
gpg --decrypt example.txt.gpg gpg --output example.txt --decrypt example.txt.gpg
gpg --gen-key gpg --full-generate-key
To list a summary of all keys
gpg --list-keys gpg --list-secret-keys
To show your public key
gpg --armor --export
To show the fingerprint for a key
gpg --fingerprint KEY_ID
gpg --search-keys 'user@emailaddress.com'
gpg --output ~/public_key.txt --armor --export KEY_ID gpg --output ~/private_key.txt --armor --export-secret-key KEY_ID
Retrieve the key files which you previously exported.
gpg --import ~/public_key.txt gpg --allow-secret-key-import --import ~/private_key.txt
Then delete the private key file.
shred -zu ~/private_key.txt
Retrieve key ID then delete
gpg --list-secret-keys gpg --list-keys gpg --delete-keys ID gpg --delete-secret-keys ID