From dc2926f45e26999b1ade78fa3ca1b2a7f81c3975 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 20 Mar 2025 00:18:13 +0000 Subject: [PATCH] Update cheatsheets --- tldr/gpg | 25 ++++++++++++------------- tldr/gpg2 | 32 +++----------------------------- tldr/linux/apt | 2 +- tldr/smartctl | 18 +++++++++++------- tldr/suspend | 2 +- 5 files changed, 28 insertions(+), 51 deletions(-) diff --git a/tldr/gpg b/tldr/gpg index 36b0d325..a677e135 100644 --- a/tldr/gpg +++ b/tldr/gpg @@ -5,38 +5,37 @@ source: https://github.com/tldr-pages/tldr.git --- # gpg -> GNU Privacy Guard. -> See `gpg2` for GNU Privacy Guard 2. Most operating systems symlink `gpg` to `gpg2`. -> More information: . +> GNU Privacy Guard, an OpenPGP encryption and signing tool. +> More information: . - Create a GPG public and private key interactively: `gpg --full-generate-key` +- List all keys from the public keyring: + +`gpg {{[-k|--list-keys]}}` + - Sign `doc.txt` without encryption (writes output to `doc.txt.asc`): `gpg --clearsign {{doc.txt}}` -- Encrypt and sign `doc.txt` for alice@example.com and bob@example.com (output to `doc.txt.gpg`): +- Encrypt and sign `doc.txt` for `alice@example.com` and `bob@example.com` (output to `doc.txt.gpg`): -`gpg --encrypt --sign --recipient {{alice@example.com}} --recipient {{bob@example.com}} {{doc.txt}}` +`gpg {{[-es|--encrypt --sign]}} {{[-r|--recipient]}} {{alice@example.com}} {{[-r|--recipient]}} {{bob@example.com}} {{doc.txt}}` - Encrypt `doc.txt` with only a passphrase (output to `doc.txt.gpg`): -`gpg --symmetric {{doc.txt}}` +`gpg {{[-c|--symmetric]}} {{doc.txt}}` - Decrypt `doc.txt.gpg` (output to `stdout`): -`gpg --decrypt {{doc.txt.gpg}}` +`gpg {{[-d|--decrypt]}} {{doc.txt.gpg}}` - Import a public key: `gpg --import {{public.gpg}}` -- Export public key for alice@example.com (output to `stdout`): +- Export the public/private key for `alice@example.com` (output to `stdout`): -`gpg --export --armor {{alice@example.com}}` - -- Export private key for alice@example.com (output to `stdout`): - -`gpg --export-secret-keys --armor {{alice@example.com}}` +`gpg {{--export|--export-secret-keys}} {{[-a|--armor]}} {{alice@example.com}}` diff --git a/tldr/gpg2 b/tldr/gpg2 index 3230f72a..5a3fd58a 100644 --- a/tldr/gpg2 +++ b/tldr/gpg2 @@ -5,34 +5,8 @@ source: https://github.com/tldr-pages/tldr.git --- # gpg2 -> GNU Privacy Guard 2. -> See `gpg` for GNU Privacy Guard 1. -> More information: . +> This command is an alias of `gpg`. -- List imported keys: +- View documentation for the original command: -`gpg2 --list-keys` - -- Encrypt a specified file for a specified recipient, writing the output to a new file with `.gpg` appended: - -`gpg2 --encrypt --recipient {{alice@example.com}} {{path/to/doc.txt}}` - -- Encrypt a specified file with only a passphrase, writing the output to a new file with `.gpg` appended: - -`gpg2 --symmetric {{path/to/doc.txt}}` - -- Decrypt a specified file, writing the result to `stdout`: - -`gpg2 --decrypt {{path/to/doc.txt.gpg}}` - -- Import a public key: - -`gpg2 --import {{path/to/public_key.gpg}}` - -- Export the public key of a specified email address to `stdout`: - -`gpg2 --export --armor {{alice@example.com}}` - -- Export the private key with a specified email address to `stdout`: - -`gpg2 --export-secret-keys --armor {{alice@example.com}}` +`tldr gpg` diff --git a/tldr/linux/apt b/tldr/linux/apt index 4c8cb440..0ad0d656 100644 --- a/tldr/linux/apt +++ b/tldr/linux/apt @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git `sudo apt update` -- Search for a given package: +- Search for a given package (use `apt search -n package` to search within package name only): `apt search {{package}}` diff --git a/tldr/smartctl b/tldr/smartctl index bb1c6b96..ec241ce7 100644 --- a/tldr/smartctl +++ b/tldr/smartctl @@ -6,24 +6,28 @@ source: https://github.com/tldr-pages/tldr.git # smartctl > Monitor disk health including SMART data. -> More information: . +> More information: . - Display SMART health summary: -`sudo smartctl --health {{/dev/sdX}}` +`sudo smartctl {{[-H|--health]}} {{/dev/sdX}}` - Display device information: -`sudo smartctl --info {{/dev/sdX}}` +`sudo smartctl {{[-i|--info]}} {{/dev/sdX}}` -- Start a short self-test in the background: +- Start a short/long self-test in the background: -`sudo smartctl --test short {{/dev/sdX}}` +`sudo smartctl {{[-t|--test]}} {{short|long}} {{/dev/sdX}}` + +- Display the self-test log: + +`sudo smartctl {{[-l|--log]}} selftest` - Display current/last self-test status and other SMART capabilities: -`sudo smartctl --capabilities {{/dev/sdX}}` +`sudo smartctl {{[-c|--capabilities]}} {{/dev/sdX}}` - Display exhaustive SMART data: -`sudo smartctl --all {{/dev/sdX}}` +`sudo smartctl {{[-a|--all]}} {{/dev/sdX}}` diff --git a/tldr/suspend b/tldr/suspend index 2f034471..45930e75 100644 --- a/tldr/suspend +++ b/tldr/suspend @@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git `{{bash}} suspend` -- Run in a separate terminal to continue from suspension if `suspend` was used in a non-nested shell: +- Continue from suspension if `suspend` was used in a non-nested shell (run this in a separate terminal): `pkill -CONT bash`