Update cheatsheets

This commit is contained in:
ivuorinen
2025-12-10 00:21:50 +00:00
parent e9c1654811
commit 9b844dc12b
21 changed files with 69 additions and 42 deletions

View File

@@ -5,10 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# arch
> Display the name of the system architecture.
> See also: `uname`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/arch-invocation.html>.
> This command is an alias of `uname --machine`.
- Display the system's architecture:
- View documentation for the original command:
`arch`
`tldr uname`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# hostname
> Show or set the system's host name.
> More information: <https://manned.org/hostname>.
> More information: <https://www.gnu.org/software/inetutils/manual/inetutils.html#hostname-invocation>.
- Show current host name:

View File

@@ -28,6 +28,14 @@ source: https://github.com/tldr-pages/tldr.git
`id {{[-g|--group]}}`
- Display all groups the current user belongs to:
`id {{[-Gn|--groups --name]}}`
- Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong:
`id {{username}}`
- Skip name lookup and specify the UID number explicitly:
`id +{{uid_number}}`

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- List all user-defined file labelling rules without headings:
`sudo semanage fcontext {{[-l|--list]}} {{[-C|--locallist]}} {{[-n|--noheading]}}`
`sudo semanage fcontext {{[-lCn|--list --locallist --noheading]}}`
- Add a user-defined rule that labels any path which matches a PCRE `regex`:
@@ -27,4 +27,4 @@ source: https://github.com/tldr-pages/tldr.git
- Relabel a directory recursively by applying the new rules:
`restorecon -R -v {{path/to/directory}}`
`restorecon -Rv {{path/to/directory}}`

View File

@@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git
`systemctl mount-image {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}}`
- Mount the images `root` partition with read-only and no-setuid options:
- Mount the image's `root` partition with read-only and no-setuid options:
`systemctl mount-image {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}} root:ro,nosuid`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# logname
> Shows the user's login name.
> See also: `id`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/logname-invocation.html>.
- Display the currently logged in user's name:

View File

@@ -7,12 +7,25 @@ source: https://github.com/tldr-pages/tldr.git
> Execute a program with a custom scheduling priority (niceness).
> Niceness values range from -20 (the highest priority) to 19 (the lowest).
> Note: Some modern schedulers ignore niceness or limit its effects inside autogroups.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/nice-invocation.html>.
- Launch a program with altered priority:
- Print the current niceness value:
`nice`
- Increment the current niceness value by 10:
`nice nice`
- Launch a program with lowered priority:
`nice -{{niceness_value}} {{command}}`
- Launch a program with heightened priority:
`sudo nice --{{niceness_value}} {{command}}`
- Define the priority with an explicit option:
`nice {{[-n|--adjustment]}} {{niceness_value}} {{command}}`

View File

@@ -12,6 +12,18 @@ source: https://github.com/tldr-pages/tldr.git
`numfmt --from si 1.5K`
- Convert 1500 to 1.5K (SI Units):
`numfmt --to si 1500`
- Convert 1.5K (IEC Units) to 1536:
`numfmt --from iec 1.5K`
- Use appropriate conversion based on the suffix:
`numfmt --from auto {{1.5Ki}}`
- Convert 5th field (1-indexed) to IEC Units without converting header:
`ls -l | numfmt --header=1 --field 5 --to iec`

View File

@@ -8,6 +8,6 @@ source: https://github.com/tldr-pages/tldr.git
> Dump of traceroute data in an easily parsed format.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Output the traceroute of `warts` files one after the other in an easy-to-parse format:
- Output the traceroute of `.warts` files one after the other in an easy-to-parse format:
`sc_analysis_dump {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -8,14 +8,14 @@ source: https://github.com/tldr-pages/tldr.git
> Display traceroute paths where the path has changed.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Show the difference between traceroutes in two `warts` files:
- Show the difference between traceroutes in two `.warts` files:
`sc_tracediff {{path/to/file1.warts}} {{path/to/file2.warts}}`
- Show the difference between the traceroutes in two `warts` files, including those that have not changed:
- Show the difference between the traceroutes in two `.warts` files, including those that have not changed:
`sc_tracediff -a {{path/to/file1.warts}} {{path/to/file2.warts}}`
- Show the difference between the traceroutes in two `warts` files and try to show DNS names and not IP addresses if possible:
- Show the difference between the traceroutes in two `.warts` files and try to show DNS names and not IP addresses if possible:
`sc_tracediff -n {{path/to/file1.warts}} {{path/to/file2.warts}}`

View File

@@ -5,9 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_ttlexp
> Dump source addresses from ICMP TTL expired messages in `warts` files.
> Dump source addresses from ICMP TTL expired messages in `.warts` files.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Output the source address of ICMP TTL expire messages in `warts` files one after the other:
- Output the source address of ICMP TTL expire messages in `.warts` files one after the other:
`sc_ttlexp {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -8,6 +8,6 @@ source: https://github.com/tldr-pages/tldr.git
> Dump traceroutes collected by `scamper` in CSV format.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Convert traceroute data in `warts` files to CSV and output it:
- Convert traceroute data in `.warts` files to CSV and output it:
`sc_warts2csv {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -5,9 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_warts2json
> JSON dump of information contained in a `warts` file.
> JSON dump of information contained in a `.warts` file.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Convert `warts` files to JSON and output the result:
- Convert `.warts` files to JSON and output the result:
`sc_warts2json {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -5,14 +5,14 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_warts2pcap
> Write packets included in `warts` object to a PCAP file.
> This is only possible for tbit, sting and sniff.
> Write packets included in `.warts` files to a PCAP file.
> This is only possible for packets of type `tbit`, `sting` or `sniff`.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Convert the data from several `warts` files into one PCAP file:
- Convert the data from several `.warts` files into one PCAP file:
`sc_warts2pcap -o {{path/to/output.pcap}} {{path/to/file1.warts path/to/file2.warts ...}}`
- Convert the data from a `warts` file into a PCAP file and sort the packets by timestamp:
- Convert the data from a `.warts` file into a PCAP file and sort the packets by timestamp:
`sc_warts2pcap -s -o {{path/to/output.pcap}} {{path/to/file.warts}}`

View File

@@ -5,9 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_warts2text
> Simple dump of information contained in a `warts` file.
> Simple dump of information contained in a `.warts` file.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Output the information in `warts` files as text:
- Output the information in `.warts` files as text:
`sc_warts2text {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -5,9 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_wartscat
> Concatenate `warts` files.
> Concatenate `.warts` files.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Concatenate `warts` files into one:
- Concatenate `.warts` files into one:
`sc_wartscat -o {{path/to/output.warts}} {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -5,9 +5,9 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_wartsdump
> Verbose dump of information contained in a `warts` file.
> Verbose dump of information contained in a `.warts` file.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Output the content of `warts` files verbose:
- Output the content of `.warts` files verbose:
`sc_wartsdump {{path/to/file1.warts path/to/file2.warts ...}}`

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_wartsfilter
> Select specific records from a `warts` file.
> Select specific records from a `.warts` file.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Filter all data records that had specific destinations and write them to a separate file:

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
---
# sc_wartsfix
> Truncate damaged `warts` files.
> Truncate damaged `.warts` files.
> More information: <https://www.caida.org/catalog/software/scamper/>.
- Save all records (in a separate file) up to the last intact one:

View File

@@ -21,14 +21,14 @@ source: https://github.com/tldr-pages/tldr.git
`scamper -c "{{ping}} -P {{UDP-dport}} -d {{33434}}" -i {{192.0.2.1}} -i {{192.0.2.2}}`
- Use the Multipath Discovery Algorithm (MDA) to determine the presence of load-balanced paths to the destination and use ICMP echo packets to sample with a maximum of three attempts, write the result to a `warts` file:
- Use the Multipath Discovery Algorithm (MDA) to determine the presence of load-balanced paths to the destination and use ICMP echo packets to sample with a maximum of three attempts, write the result to a `.warts` file:
`scamper -O {{warts}} -o {{path/to/output.warts}} -I "{{tracelb}} -P {{ICMP-echo}} -q {{3}} {{192.0.2.1}}"`
- Execute a Paris traceroute with ICMP to a destination and save the result in a compressed `warts` file:
- Execute a Paris traceroute with ICMP to a destination and save the result in a compressed `.warts` file:
`scamper -O {{warts.gz}} -o {{path/to/output.warts}} -I "{{trace}} -P {{icmp-paris}} {{2001:db8:dead:beaf::4}}"`
- Record all ICMP packets that arrive at a specific IP address and have a specific ICMP ID in a `warts` file:
- Record all ICMP packets that arrive at a specific IP address and have a specific ICMP ID in a `.warts` file:
`scamper -O {{warts}} -o {{path/to/output.warts}} -I "sniff -S {{2001:db8:dead:beef::6}} icmp[icmpid] == {{101}}"`

View File

@@ -5,13 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# whoami
> Print the username associated with the current effective user ID.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/whoami-invocation.html>.
> This command is an alias of `id --user --name`.
- Display currently logged username:
- View documentation for the original command:
`whoami`
- Display the username after a change in the user ID:
`sudo whoami`
`tldr id`