Update cheatsheets

This commit is contained in:
ivuorinen
2025-11-10 00:21:37 +00:00
parent 15848b0938
commit 9420175cb8
27 changed files with 159 additions and 74 deletions

View File

@@ -10,12 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
- Show the current ARP table:
`arp`
- Show [a]lternative BSD style output format with on fixed columns:
`arp -a`
- [d]elete a specific entry:
`arp -d {{address}}`
`sudo arp -d {{address}}`
- [s]et up a new entry in the ARP table:
`arp -s {{address}} {{mac_address}}`
`sudo arp -s {{address}} {{mac_address}}`

View File

@@ -12,9 +12,9 @@ source: https://github.com/tldr-pages/tldr.git
`cadaver {{http://dav.example.com/}}`
- Connect to a server using a specific port and open the collection `/foo/bar/`:
- Connect to a server using a specific port and open a collection:
`cadaver {{http://dav.example.com:8022/foo/bar/}}`
`cadaver {{http://dav.example.com:8022/path/to/collection/}}`
- Connect to a server using SSL:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# doas
> Execute a command as another user.
> See also: `sudo`, `pkexec`, `run0`.
> More information: <https://man.openbsd.org/doas>.
- Run a command as root:

View File

@@ -12,23 +12,23 @@ source: https://github.com/tldr-pages/tldr.git
- Update the list of available packages and versions (it's recommended to run this before other `apt-get` commands):
`apt-get update`
`sudo apt-get update`
- Install a package, or update it to the latest available version:
`apt-get install {{package}}`
`sudo apt-get install {{package}}`
- Remove a package:
`apt-get remove {{package}}`
`sudo apt-get remove {{package}}`
- Remove a package and its configuration files:
`apt-get purge {{package}}`
`sudo apt-get purge {{package}}`
- Upgrade all installed packages to their newest available versions:
`apt-get upgrade`
`sudo apt-get upgrade`
- Clean the local repository - removing package files (`.deb`) from interrupted downloads that can no longer be downloaded:
@@ -36,8 +36,8 @@ source: https://github.com/tldr-pages/tldr.git
- Remove all packages that are no longer needed:
`apt-get autoremove`
`sudo apt-get autoremove`
- Upgrade installed packages (like `upgrade`), but remove obsolete packages and install additional packages to meet new dependencies:
`apt-get dist-upgrade`
`sudo apt-get dist-upgrade`

View File

@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
- Synchronize list of packages and versions available. This should be run first, before running subsequent `aptitude` commands:
`aptitude update`
`sudo aptitude update`
- Install a new package and its dependencies:
`aptitude install {{package}}`
`sudo aptitude install {{package}}`
- Search for a package:
@@ -26,16 +26,16 @@ source: https://github.com/tldr-pages/tldr.git
- Remove a package and all packages depending on it:
`aptitude remove {{package}}`
`sudo aptitude remove {{package}}`
- Upgrade installed packages to the newest available versions:
`aptitude upgrade`
`sudo aptitude upgrade`
- Upgrade installed packages (like `aptitude upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies:
`aptitude full-upgrade`
`sudo aptitude full-upgrade`
- Put an installed package on hold to prevent it from being automatically upgraded:
`aptitude hold '?installed({{package}})'`
`sudo aptitude hold '?installed({{package}})'`

View File

@@ -11,11 +11,11 @@ source: https://github.com/tldr-pages/tldr.git
- Make a bootable USB drive from an isohybrid file (such as `archlinux-xxx.iso`) and show the progress:
`dd if={{path/to/file.iso}} of={{/dev/usb_drive}} status=progress`
`sudo dd if={{path/to/file.iso}} of={{/dev/usb_drive}} status=progress`
- Clone a drive to another drive with 4 MiB block size and flush writes before the command terminates:
`dd bs=4M conv=fsync if={{/dev/source_drive}} of={{/dev/dest_drive}}`
`sudo dd bs=4M conv=fsync if={{/dev/source_drive}} of={{/dev/dest_drive}}`
- Generate a file with a specific number of random bytes by using kernel random driver:
@@ -31,4 +31,4 @@ source: https://github.com/tldr-pages/tldr.git
- Check the progress of an ongoing `dd` operation (run this command from another shell):
`kill -USR1 $(pgrep {{[-x|--exact]}} dd)`
`progress`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# dmesg
> Write the kernel messages to `stdout`.
> See also: `journalctl`.
> More information: <https://manned.org/dmesg>.
- Show kernel messages:

View File

@@ -12,11 +12,11 @@ source: https://github.com/tldr-pages/tldr.git
- Install a package:
`dpkg {{[-i|--install]}} {{path/to/file.deb}}`
`sudo dpkg {{[-i|--install]}} {{path/to/file.deb}}`
- Remove a package:
`dpkg {{[-r|--remove]}} {{package}}`
`sudo dpkg {{[-r|--remove]}} {{package}}`
- List installed packages:
@@ -36,4 +36,4 @@ source: https://github.com/tldr-pages/tldr.git
- Purge an installed or already removed package, including configuration:
`dpkg {{[-P|--purge]}} {{package}}`
`sudo dpkg {{[-P|--purge]}} {{package}}`

View File

@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
- Display the current time as reported by the hardware clock:
`hwclock`
`sudo hwclock`
- Write the current software clock time to the hardware clock (sometimes used during system setup):
`hwclock {{[-w|--systohc]}}`
`sudo hwclock {{[-w|--systohc]}}`
- Write the current hardware clock time to the software clock:
`hwclock {{[-s|--hctosys]}}`
`sudo hwclock {{[-s|--hctosys]}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# journalctl
> Query the systemd journal.
> See also: `dmesg`.
> More information: <https://www.freedesktop.org/software/systemd/man/journalctl.html>.
- Show all messages with priority level 3 (errors) from this boot:

21
tldr/linux/koji-buildinfo Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# koji buildinfo
> Print basic information about a build.
> More information: <https://docs.pagure.org/koji>.
- Print basic information:
`koji buildinfo {{BuildID_or_NVR1 BuildID_or_NRV2 ...}}`
- Print basic information with changelog:
`koji buildinfo {{BuildID_or_NVR1 BuildID_or_NRV2 ...}} --changelog`
- Display help:
`koji buildinfo --help`

View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# koji download-build
> Download a built package.
> More information: <https://docs.pagure.org/koji>.
- Download all RPMs from a specific build:
`koji download-build {{BuildID|RPM|NVR}}`
- Download RPMs signed with the given key:
`koji download-build {{BuildID|RPM|NVR}} --key {{key}}`
- Only download RPMs for given arch:
`koji download-build {{BuildID|RPM|NVR}} --arch {{x86_64,aarch64,noarch,...}}`
- Download the given RPM:
`koji download-build {{RPM}} --rpm`
- Display help:
`koji download-build --help`

25
tldr/linux/koji-tag-build Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# koji tag-build
> Apply a tag to one or more builds.
> More information: <https://docs.pagure.org/koji>.
- Apply a tag to one or more builds:
`koji tag-build {{tag}} {{NVR1 NVR2 ...}}`
- Don't wait on task:
`koji tag-build {{tag}} {{NVR1 NVR2 ...}} --nowait`
- Force operation:
`koji tag-build {{tag}} {{NVR1 NVR2 ...}} --force`
- Display help:
`koji tag-build --help`

View File

@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
- List verbose information about USB devices:
`lsusb {{[-v|--verbose]}}`
`sudo lsusb {{[-v|--verbose]}}`
- List detailed information about a USB device:
`lsusb {{[-v|--verbose]}} -s {{bus}}:{{device number}}`
`sudo lsusb {{[-v|--verbose]}} -s {{bus}}:{{device number}}`
- List devices with a specified vendor and product ID only:

View File

@@ -11,28 +11,28 @@ source: https://github.com/tldr-pages/tldr.git
- Display information about logical volumes:
`lvs`
`sudo lvs`
- Display all logical volumes:
`lvs {{[-a|--all]}}`
`sudo lvs {{[-a|--all]}}`
- Change default display to show more details:
`lvs {{[-v|--verbose]}}`
`sudo lvs {{[-v|--verbose]}}`
- Display only specific fields:
`lvs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
`sudo lvs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
- Append field to default display:
`lvs {{[-o|--options]}} +{{field_name}}`
`sudo lvs {{[-o|--options]}} +{{field_name}}`
- Suppress heading line:
`lvs --noheadings`
`sudo lvs --noheadings`
- Use a separator to separate fields:
`lvs --separator {{=}}`
`sudo lvs --separator {{=}}`

View File

@@ -7,6 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Execute commands as another user.
> Asks for password in a GUI if available.
> See also: `sudo`, `run0`, `doas`.
> More information: <https://polkit.pages.freedesktop.org/polkit/pkexec.1.html>.
- Run command as root:

View File

@@ -11,28 +11,28 @@ source: https://github.com/tldr-pages/tldr.git
- Display information about physical volumes:
`pvs`
`sudo pvs`
- Display non-physical volumes:
`pvs {{[-a|--all]}}`
`sudo pvs {{[-a|--all]}}`
- Change default display to show more details:
`pvs {{[-v|--verbose]}}`
`sudo pvs {{[-v|--verbose]}}`
- Display only specific fields:
`pvs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
`sudo pvs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
- Append field to default display:
`pvs {{[-o|--options]}} +{{field_name}}`
`sudo pvs {{[-o|--options]}} +{{field_name}}`
- Suppress heading line:
`pvs --noheadings`
`sudo pvs --noheadings`
- Use separator to separate fields:
`pvs --separator {{special_character}}`
`sudo pvs --separator {{special_character}}`

View File

@@ -7,6 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
> Elevate privileges interactively.
> Similar to `sudo`, but it's not a SUID binary, authentication takes place via polkit, and commands are invoked from a `systemd` service.
> See also: `sudo`, `pkexec`, `doas`.
> More information: <https://www.freedesktop.org/software/systemd/man/run0.html>.
- Run a command as root:

View File

@@ -10,19 +10,19 @@ source: https://github.com/tldr-pages/tldr.git
- Start tracing a specific process by its PID:
`strace {{[-p|--attach]}} {{pid}}`
`sudo strace {{[-p|--attach]}} {{pid}}`
- Trace a process and filter output by system call [e]xpression:
`strace {{[-p|--attach]}} {{pid}} -e {{system_call,system_call2,...}}`
`sudo strace {{[-p|--attach]}} {{pid}} -e {{system_call,system_call2,...}}`
- Count time, calls, and errors for each system call and report a summary on program exit:
`strace {{[-p|--attach]}} {{pid}} {{[-c|--summary-only]}}`
`sudo strace {{[-p|--attach]}} {{pid}} {{[-c|--summary-only]}}`
- Show the time spent in every system call and specify the maximum string size to print:
`strace {{[-p|--attach]}} {{pid}} {{[-T|--syscall-times]}} {{[-s|--string-limit]}} {{32}}`
`sudo strace {{[-p|--attach]}} {{pid}} {{[-T|--syscall-times]}} {{[-s|--string-limit]}} {{32}}`
- Start tracing a program by executing it:

View File

@@ -11,32 +11,32 @@ source: https://github.com/tldr-pages/tldr.git
- Enable `ufw`:
`ufw enable`
`sudo ufw enable`
- Disable `ufw`:
`ufw disable`
`sudo ufw disable`
- Show `ufw` rules, along with their numbers:
`ufw status numbered`
`sudo ufw status numbered`
- Allow incoming traffic on port 5432 on this host with a comment identifying the service:
`ufw allow 5432 comment "{{Service}}"`
`sudo ufw allow 5432 comment "{{Service}}"`
- Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22:
`ufw allow proto tcp from 192.168.0.4 to any port 22`
`sudo ufw allow proto tcp from 192.168.0.4 to any port 22`
- Deny traffic on port 80 on this host:
`ufw deny 80`
`sudo ufw deny 80`
- Deny all UDP traffic to ports in range 8412:8500:
`ufw deny proto udp from any to any port 8412:8500`
`sudo ufw deny proto udp from any to any port 8412:8500`
- Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command:
`ufw delete {{rule_number}}`
`sudo ufw delete {{rule_number}}`

View File

@@ -11,28 +11,28 @@ source: https://github.com/tldr-pages/tldr.git
- Display information about volume groups:
`vgs`
`sudo vgs`
- Display all volume groups:
`vgs {{[-a|--all]}}`
`sudo vgs {{[-a|--all]}}`
- Change default display to show more details:
`vgs {{[-v|--verbose]}}`
`sudo vgs {{[-v|--verbose]}}`
- Display only specific fields:
`vgs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
`sudo vgs {{[-o|--options]}} {{field_name_1}},{{field_name_2}}`
- Append field to default display:
`vgs {{[-o|--options]}} +{{field_name}}`
`sudo vgs {{[-o|--options]}} +{{field_name}}`
- Suppress heading line:
`vgs --noheadings`
`sudo vgs --noheadings`
- Use separator to separate fields:
`vgs --separator =`
`sudo vgs --separator =`

View File

@@ -11,19 +11,19 @@ source: https://github.com/tldr-pages/tldr.git
- Synchronize list of packages and versions available:
`zypper {{[ref|refresh]}}`
`sudo zypper {{[ref|refresh]}}`
- Install a new package:
`zypper {{[in|install]}} {{package}}`
`sudo zypper {{[in|install]}} {{package}}`
- Remove a package:
`zypper {{[rm|remove]}} {{package}}`
`sudo zypper {{[rm|remove]}} {{package}}`
- Upgrade installed packages to the newest available versions:
`zypper {{[up|update]}}`
`sudo zypper {{[up|update]}}`
- Search package via keyword:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Receive JSON data and pretty print the output:
`echo '{"hello":"world"}' | mlr --ijson --opprint cat`
`{{echo '{"key":"value"}'}} | mlr --ijson --opprint cat`
- Sort alphabetically on a field:
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Receive JSON and format the output as vertical JSON:
`echo '{"hello":"world", "foo":"bar"}' | mlr --ijson --ojson --jvstack cat`
`{{echo '{"key1":"value1", "key2":"value2"}'}} | mlr --ijson --ojson --jvstack cat`
- Filter lines of a compressed CSV file treating numbers as [S]trings:

View File

@@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git
- Log in to a private registry with a specific scope:
`npm login --scope {{@mycorp}} --registry {{https://registry.mycorp.com}}`
`npm login --scope {{@organization}} --registry {{https://registry.example.com}}`
- Log out from a specific scope and remove the auth token:
`npm logout --scope {{@mycorp}}`
`npm logout --scope {{@organization}}`
- Create a scoped package during initialization:
`npm init --scope {{@foo}} {{[-y|--yes]}}`
`npm init --scope {{@organization}} {{[-y|--yes]}}`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Run a specific command:
`robo {{foo}}`
`robo {{command}}`
- Simulate running a specific command:
`robo --simulate {{foo}}`
`robo --simulate {{command}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# sudo
> Execute a single command as the superuser or another user.
> See also: `pkexec`, `run0`, `doas`.
> More information: <https://www.sudo.ws/sudo.html>.
- Run a command as the superuser:

View File

@@ -12,11 +12,11 @@ source: https://github.com/tldr-pages/tldr.git
- Download the contents of a URL to a file using multiple threads (default behavior differs from `wget`):
`wget2 {{https://example.com/foo}}`
`wget2 {{https://example.com/resource}}`
- Limit the number of threads used for downloading (default is 5 threads):
`wget2 --max-threads {{10}} {{https://example.com/foo}}`
`wget2 --max-threads {{10}} {{https://example.com/resource}}`
- Download a single web page and all its resources (scripts, stylesheets, images, etc.):