Decrypt backup.txt.gpg and write the result to backup.txt.
Which command is appropriate?
Use --decrypt to decrypt the input and --output to choose the destination file.
Detailed explanation
gpg --encrypt backup.txt.gpg --output backup.txtCorrect. --decrypt reads the ciphertext and --output writes the plaintext to backup.txt.
Correct. --decrypt reads the ciphertext and --output writes the plaintext to backup.txt.
gpg --decrypt backup.txt.gpg --output backup.txtIncorrect. --encrypt performs encryption, not decryption.
Incorrect. --encrypt performs encryption, not decryption.
gpg --sign backup.txt.gpg --output backup.txtIncorrect. --sign creates a signature.
Incorrect. --sign creates a signature.
gpg --list-keys backup.txt.gpg --output backup.txtIncorrect. --list-keys lists keys and does not decrypt files.
Incorrect. --list-keys lists keys and does not decrypt files.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'gpg --decrypt backup.txt.gpg --output backup.txt'Expected result
gpg --decrypt backup.txt.gpg --output backup.txtKey points
- --decrypt
- --output
- Opposite of encryption
Notes
- Environment: GnuPGのコマンド役割確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.