Linux command
age 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Encrypt
age -p [file.txt] > [file.txt.age]
Decrypt
age -d [file.txt.age] > [file.txt]
Example
age -r [age1publickey...] [file.txt] > [file.txt.age]
Example
age -r [key1] -r [key2] [file.txt] > [file.txt.age]
Example
age -R [~/.ssh/id_ed25519.pub] [file.txt] > [file.txt.age]
Example
age -d -i [key.txt] [file.txt.age] > [file.txt]
说明
age is a simple, modern file encryption tool with small explicit keys, no config options, and composable with Unix pipes. It's designed as a replacement for GPG with a cleaner interface and fewer footguns. age supports encryption to one or more recipients, passphrase encryption, and can use SSH keys for recipient-based encryption. The format is designed to be simple and auditable.
参数
- -e, --encrypt
- Encrypt input (default operation)
- -d, --decrypt
- Decrypt input
- -p, --passphrase
- Encrypt with passphrase
- -r _recipient_
- Encrypt to recipient public key (repeatable)
- -R _file_
- Read recipients from file (one per line)
- -i _identity_
- Identity file for decryption
- -o _file_
- Output file (default: stdout)
- -a, --armor
- Use ASCII armored format
FAQ
What is the age command used for?
age is a simple, modern file encryption tool with small explicit keys, no config options, and composable with Unix pipes. It's designed as a replacement for GPG with a cleaner interface and fewer footguns. age supports encryption to one or more recipients, passphrase encryption, and can use SSH keys for recipient-based encryption. The format is designed to be simple and auditable.
How do I run a basic age example?
Run `age -p [file.txt] > [file.txt.age]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e, --encrypt do in age?
Encrypt input (default operation)