Update cheatsheets

This commit is contained in:
ivuorinen
2025-08-27 00:19:48 +00:00
parent 114611fd19
commit 9565d2532c
21 changed files with 167 additions and 54 deletions

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Show changes from all commits since a given date/time (a date expression, e.g. "1 week 2 days" or an ISO date): - Show changes from all commits since a given date/time (a date expression, e.g. "1 week 2 days" or an ISO date):
`git diff 'HEAD@{3 months|weeks|days|hours|seconds ago}'` `git diff 'HEAD@{{{3 months|weeks|days|hours|seconds ago}}}'`
- Show diff statistics, like files changed, histogram, and total line insertions/deletions: - Show diff statistics, like files changed, histogram, and total line insertions/deletions:
@@ -34,7 +34,7 @@ source: https://github.com/tldr-pages/tldr.git
- Compare a single file between two branches or commits: - Compare a single file between two branches or commits:
`git diff {{branch_1}}..{{branch_2}} [--] {{path/to/file}}` `git diff {{branch_1}}..{{branch_2}} {{path/to/file}}`
- Compare different files from the current branch to other branch: - Compare different files from the current branch to other branch:

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# git init # git init
> Initializes a new local Git repository. > Initialize a new local Git repository.
> More information: <https://git-scm.com/docs/git-init>. > More information: <https://git-scm.com/docs/git-init>.
- Initialize a new local repository: - Initialize a new local repository:
@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Initialize a repository using SHA256 for object hashes (requires Git version 2.29+): - Initialize a repository using SHA256 for object hashes (requires Git version 2.29+):
`git init --object-format {{sha256}}` `git init --object-format sha256`
- Initialize a barebones repository, suitable for use as a remote over SSH: - Initialize a barebones repository, suitable for use as a remote over SSH:

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Move a file inside the repo and add the movement to the next commit: - Move a file inside the repo and add the movement to the next commit:
`git mv {{path/to/file}} {{new/path/to/file}}` `git mv {{path/to/file}} {{path/to/destination}}`
- Rename a file or directory and add the renaming to the next commit: - Rename a file or directory and add the renaming to the next commit:

View File

@@ -31,3 +31,11 @@ source: https://github.com/tldr-pages/tldr.git
- Redirect `stderr` to `stdout` for piping them together: - Redirect `stderr` to `stdout` for piping them together:
`{{command1}} 2>&1 | {{command2}}` `{{command1}} 2>&1 | {{command2}}`
- Open a persistent file descriptor:
`exec {{3}}>{{path/to/file}}`
- Write to a custom file descriptor:
`{{echo text}} >&{{3}}`

View File

@@ -35,3 +35,7 @@ source: https://github.com/tldr-pages/tldr.git
- Pass command output to a program as a file descriptor: - Pass command output to a program as a file descriptor:
`diff <({{command1}}) <({{command2}})` `diff <({{command1}}) <({{command2}})`
- Open a persistent file descriptor:
`exec {{3}}<{{path/to/file}}`

21
tldr/less-than-more-than Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# <>
> Open a file descriptor for read and write.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Opening-File-Descriptors-for-Reading-and-Writing>.
- Open a file in a file descriptor for read an write:
`exec {{3}}<>{{path/to/file}}`
- Open a file descriptor to a remote connection:
`exec {{3}}<>/dev/{{tcp}}/{{remote_host}}/{{port_number}}`
- Close a file descriptor:
`exec {{3}}<>-`

View File

@@ -32,7 +32,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo apachectl graceful` `sudo apachectl graceful`
- Print full Apache configuration: - Print full Apache configuration (not always supported):
`apachectl -S` `apachectl -S`

View File

@@ -19,3 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Play the raw file as a 22050 Hz, mono, 8-bit, Mu-Law `.au` file: - Play the raw file as a 22050 Hz, mono, 8-bit, Mu-Law `.au` file:
`aplay {{[-c|--channels]}} {{1}} {{[-t|--file-type]}} {{raw}} {{[-r|--rate]}} {{22050}} {{[-f|--format]}} {{mu_law}} {{path/to/file}}` `aplay {{[-c|--channels]}} {{1}} {{[-t|--file-type]}} {{raw}} {{[-r|--rate]}} {{22050}} {{[-f|--format]}} {{mu_law}} {{path/to/file}}`
- List available audio devices:
`aplay {{[-l|--list-devices]}}`

View File

@@ -12,18 +12,22 @@ source: https://github.com/tldr-pages/tldr.git
`brightnessctl {{[-l|--list]}}` `brightnessctl {{[-l|--list]}}`
- Print the current brightness of the display backlight: - Print the current brightness of the default device:
`brightnessctl get` `brightnessctl {{[g|get]}}`
- Set the brightness of the display backlight to a specified percentage within range: - Print the current brightness of a specific device (can be a wildcard):
`brightnessctl set {{50%}}` `brightnessctl {{[g|get]}} {{[-d|--device]}} '{{device_name}}'`
- Increase brightness by a specified increment: - Set the brightness to a specified percentage:
`brightnessctl set {{+10%}}` `brightnessctl {{[s|set]}} {{50}}%`
- Decrease brightness by a specified decrement: - Increase brightness by a specified percentage:
`brightnessctl set {{10%-}}` `brightnessctl {{[s|set]}} +{{10}}%`
- Decrease brightness by a specified percentage:
`brightnessctl {{[s|set]}} {{10}}%-`

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# fdisk # fdisk
> Manage partition tables and partitions on a hard disk. > Manage partition tables and partitions on a storage drive.
> See also: `partprobe`. > See also: `partprobe`.
> More information: <https://manned.org/fdisk>. > More information: <https://manned.org/fdisk>.

17
tldr/linux/fgconsole Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# fgconsole
> Print the number of the foreground virtual terminal.
> More information: <https://manned.org/fgconsole>.
- Print current terminal number or `serial` if the terminal is serial:
`fgconsole`
- Print the next unallocated virtual terminal:
`fgconsole {{[-n|--next-available]}}`

17
tldr/linux/pacsift Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# pacsift
> Query and filter packages.
> More information: <https://github.com/andrewgregory/pacutils/blob/master/doc/pacsift.pod>.
- List all available packages:
`pacsift`
- Filter packages that provide a given package:
`pacsift --satisfies {{package}}`

View File

@@ -12,13 +12,13 @@ source: https://github.com/tldr-pages/tldr.git
`qm {{[cr|create]}} {{100}}` `qm {{[cr|create]}} {{100}}`
- Automatically start the machine after creation: - Give the virtual machine a name and automatically start the machine after creation:
`qm {{[cr|create]}} {{100}} --start` `qm {{[cr|create]}} {{100}} --name {{vm_name}} --start`
- Give the virtual machine a name: - Give a virtual machine specified amount of memory and CPUs:
`qm {{[cr|create]}} {{100}} --name {{vm_name}}` `qm {{[cr|create]}} {{100}} --memory {{8192}} --cores {{4}}`
- Specify the type of operating system on the machine: - Specify the type of operating system on the machine:

View File

@@ -30,4 +30,8 @@ source: https://github.com/tldr-pages/tldr.git
- Delete a device: - Delete a device:
`qm set {{100}} --delete {{device_name0}}` `qm set {{100}} --delete {{device_name0,device_name1,...}}`
- Passthrough a GPU device to the guest:
`qm set {{100}} --hostpci{{0}} {{0000:00:02}},x-vga=1 --bios ovmf`

View File

@@ -11,32 +11,32 @@ source: https://github.com/tldr-pages/tldr.git
- Show version of httpd package: - Show version of httpd package:
`rpm --query {{httpd}}` `rpm {{[-q|--query]}} {{httpd}}`
- List versions of all matching packages: - List versions of all matching packages:
`rpm --query --all '{{mariadb*}}'` `rpm {{[-qa|--query --all]}} '{{mariadb*}}'`
- Forcibly install a package regardless of currently installed versions: - Forcibly install a package regardless of currently installed versions:
`rpm --upgrade {{path/to/package.rpm}} --force` `rpm {{[-U|--upgrade]}} {{path/to/package.rpm}} --force`
- Identify owner of a file and show version of the package: - Identify owner of a file and show version of the package:
`rpm --query --file {{/etc/postfix/main.cf}}` `rpm {{[-qf|--query --file]}} {{/etc/postfix/main.cf}}`
- List package-owned files: - List package-owned files:
`rpm --query --list {{kernel}}` `rpm {{[-ql|--query --list]}} {{kernel}}`
- Show scriptlets from an RPM file: - Show scriptlets from an RPM file:
`rpm --query --package --scripts {{package.rpm}}` `rpm {{[-qp|--query --package]}} --scripts {{package.rpm}}`
- Show changed, missing and/or incorrectly installed files of matching packages: - Show changed, missing and/or incorrectly installed files of matching packages:
`rpm --verify --all '{{php-*}}'` `rpm {{[-Va|--verify --all]}} '{{php-*}}'`
- Display the changelog of a specific package: - Display the changelog of a specific package:
`rpm --query --changelog {{package}}` `rpm {{[-q|--query]}} --changelog {{package}}`

17
tldr/linux/systemctl-mask Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl mask
> Link units to `/dev/null` so that they can be even started.
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#mask%20UNIT%E2%80%A6>.
- Mask a service:
`systemctl mask {{service_name}}`
- Ensure that the service is shut down while masking:
`systemctl mask {{service_name}} --now`

View File

@@ -15,3 +15,15 @@ source: https://github.com/tldr-pages/tldr.git
- Write the output of a pipeline to the journal (`stderr` stays connected to the terminal): - Write the output of a pipeline to the journal (`stderr` stays connected to the terminal):
`{{command}} | systemd-cat` `{{command}} | systemd-cat`
- Use the specified identifier (default: `cat` when reading from a pipeline, executable name otherwise):
`{{command}} | systemd-cat {{[-t|--identifier]}} {{id}}`
- Use the specified default priority level for all logged messages:
`systemd-cat {{[-p|--priority]}} {{emerg|alert|crit|err|warning|notice|info|debug}} {{command}}`
- Use the specified default priority level for the logged messages from the command's `stderr`:
`systemd-cat --stderr-priority {{emerg|alert|crit|err|warning|notice|info|debug}} {{command}}`

View File

@@ -20,3 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print the contents of all configuration files (before each file, its name is printed as a comment): - Print the contents of all configuration files (before each file, its name is printed as a comment):
`systemd-sysusers --cat-config` `systemd-sysusers --cat-config`
- Create users based on files listed in the previous command:
`systemd-sysusers`

View File

@@ -5,30 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# yum # yum
> Package management utility for RHEL, Fedora, and CentOS (for older versions). > This command is an alias of `dnf` on modern distros.
> For equivalent commands in other package managers, see <https://wiki.archlinux.org/title/Pacman/Rosetta>. > For older distros (e.g. CentOS 7), `yum` is a distinct program from `dnf`. Some subcommands and options may be different.
> More information: <https://manned.org/yum>.
- Install a new package: - View documentation for the original command:
`yum install {{package}}` `tldr dnf`
- Install a new package and assume yes to all questions (also works with update, great for automated updates):
`yum {{[-y|--assumeyes]}} install {{package}}`
- Find the package that provides a particular command:
`yum provides {{command}}`
- Remove a package:
`yum remove {{package}}`
- Display available updates for installed packages:
`yum check-update`
- Upgrade installed packages to the newest available versions:
`yum upgrade`

22
tldr/lsix Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# lsix
> List and display images in sixel format on the terminal.
> See also: `img2sixel`.
> More information: <https://github.com/hackerb9/lsix>.
- List images in the current directory:
`lsix`
- List images in a specific directory:
`lsix {{path/to/directory}}`
- Display an image on the terminal:
`lsix {{path/to/image}}`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# wait # wait
> Wait for a process to complete before proceeding. > Wait for a process to complete before proceeding.
> See also: `ps` to view information about running processes. > See also: `ps` to view information about running processes and `waitpid`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-wait>. > More information: <https://www.gnu.org/software/bash/manual/bash.html#index-wait>.
- Wait for a process to finish given its process ID (PID) and return its exit status: - Wait for a process to finish given its process ID (PID) and return its exit status: