mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-01 14:54:22 +00:00
Update cheatsheets
This commit is contained in:
@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
|
- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
|
||||||
|
|
||||||
`grep {{[-r|--recursive]}} {{[-n|--line-number]}} {{[-I|--binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
|
`grep {{[-rnI|--recursive --line-number --binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
|
||||||
|
|
||||||
- Use extended regular expressions (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
|
- Use extended regular expressions (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
|
||||||
|
|
||||||
`grep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
|
`grep {{[-Ei|--extended-regexp --ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
|
||||||
|
|
||||||
- Print 3 lines of [C]ontext around, [B]efore or [A]fter each match:
|
- Print 3 lines of [C]ontext around, [B]efore or [A]fter each match:
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
- Print file name and line number for each match with color output:
|
- Print file name and line number for each match with color output:
|
||||||
|
|
||||||
`grep {{[-H|--with-filename]}} {{[-n|--line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
|
`grep {{[-Hn|--with-filename --line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
|
||||||
|
|
||||||
- Search for lines matching a pattern, printing only the matched text:
|
- Search for lines matching a pattern, printing only the matched text:
|
||||||
|
|
||||||
|
|||||||
25
tldr/hexedit
Normal file
25
tldr/hexedit
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# hexedit
|
||||||
|
|
||||||
|
> File editor for hexadecimal and ASCII content.
|
||||||
|
> More information: <https://manned.org/hexedit>.
|
||||||
|
|
||||||
|
- Open file:
|
||||||
|
|
||||||
|
`hexedit {{path/to/file}}`
|
||||||
|
|
||||||
|
- Display file with sectors:
|
||||||
|
|
||||||
|
`hexedit {{[-s|--sector]}} {{path/to/file}}`
|
||||||
|
|
||||||
|
- Maximize file display:
|
||||||
|
|
||||||
|
`hexedit {{[-m|--maximize]}} {{path/to/file}}`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`hexedit {{[-h|--help]}}`
|
||||||
@@ -8,14 +8,22 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
> Manage a PipeWire instance's modules, objects, nodes, devices, links and much more.
|
> Manage a PipeWire instance's modules, objects, nodes, devices, links and much more.
|
||||||
> More information: <https://docs.pipewire.org/page_man_pw-cli_1.html>.
|
> More information: <https://docs.pipewire.org/page_man_pw-cli_1.html>.
|
||||||
|
|
||||||
- Print all nodes (sinks and sources) along with their IDs:
|
- Print information of all object of a specific type:
|
||||||
|
|
||||||
`pw-cli list-objects Node`
|
`pw-cli {{[ls|list-objects]}} {{Node|Link|Port|Client|Device|Metadata|Factory|Module|Profiler|SecurityContext|Core}}`
|
||||||
|
|
||||||
- Print information about an object with a specific ID:
|
- Print information about an object with a specific ID:
|
||||||
|
|
||||||
`pw-cli info {{4}}`
|
`pw-cli {{[i|info]}} {{4}}`
|
||||||
|
|
||||||
- Print all objects' information:
|
- Print all objects' information:
|
||||||
|
|
||||||
`pw-cli info all`
|
`pw-cli {{[i|info]}} all`
|
||||||
|
|
||||||
|
- Monitor for object changes:
|
||||||
|
|
||||||
|
`pw-cli {{[-m|--monitor]}}`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`pw-cli {{[h|help]}}`
|
||||||
|
|||||||
22
tldr/linux/virt-what
Normal file
22
tldr/linux/virt-what
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# virt-what
|
||||||
|
|
||||||
|
> Shell script that detects if you are running in a virtual machine.
|
||||||
|
> Outputs a specific code for a virtual machine if detected.
|
||||||
|
> More information: <https://manned.org/virt-what>.
|
||||||
|
|
||||||
|
- Detect if you are running in a virtual machine:
|
||||||
|
|
||||||
|
`virt-what`
|
||||||
|
|
||||||
|
- Log output of `virt-what` into a file:
|
||||||
|
|
||||||
|
`virt-what > {{path/to/file}}`
|
||||||
|
|
||||||
|
- Display version:
|
||||||
|
|
||||||
|
`virt-what --version`
|
||||||
18
tldr/linux/wpexec
Normal file
18
tldr/linux/wpexec
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# wpexec
|
||||||
|
|
||||||
|
> Run WirePlumber Lua scripts.
|
||||||
|
> See also: `wpctl`, `wireplumber`.
|
||||||
|
> More information: <https://pipewire.pages.freedesktop.org/wireplumber/scripting/lua_api/lua_introduction.html>.
|
||||||
|
|
||||||
|
- Run a WirePlumber script:
|
||||||
|
|
||||||
|
`wpexec {{path/to/file.lua}}`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`wpexec --help`
|
||||||
@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
# nano
|
# nano
|
||||||
|
|
||||||
> Command-line text editor. An enhanced `Pico` clone.
|
> Command-line text editor. An enhanced `Pico` clone.
|
||||||
|
> See also: `pico`, `rnano`.
|
||||||
> More information: <https://nano-editor.org>.
|
> More information: <https://nano-editor.org>.
|
||||||
|
|
||||||
- Start the editor:
|
- Start the editor:
|
||||||
|
|||||||
14
tldr/on_ac_power
Normal file
14
tldr/on_ac_power
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# on_ac_power
|
||||||
|
|
||||||
|
> A simple utility which tests if a computer is running on line power.
|
||||||
|
> Returns `0` if yes, and `1` if no.
|
||||||
|
> More information: <https://manned.org/on_ac_power>.
|
||||||
|
|
||||||
|
- Test if a computer is running on line power:
|
||||||
|
|
||||||
|
`on_ac_power`
|
||||||
41
tldr/pico
Normal file
41
tldr/pico
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# pico
|
||||||
|
|
||||||
|
> Text editor styled after the Alpine Composer.
|
||||||
|
> More information: <https://manned.org/pico>.
|
||||||
|
|
||||||
|
- Start the editor:
|
||||||
|
|
||||||
|
`pico {{path/to/file}}`
|
||||||
|
|
||||||
|
- Start the editor with the cursor located n lines into the file:
|
||||||
|
|
||||||
|
`pico +{{n}} {{path/to/file}}`
|
||||||
|
|
||||||
|
- Start the editor with the cursor shown before the current selection:
|
||||||
|
|
||||||
|
`pico -g {{path/to/file}}`
|
||||||
|
|
||||||
|
- Define the quote string for files such as email:
|
||||||
|
|
||||||
|
`pico -Q "{{quotestring}}" {{path/to/file}}`
|
||||||
|
|
||||||
|
- Enable mouse functionality when run within an `xterm` window:
|
||||||
|
|
||||||
|
`pico -m {{path/to/file}}`
|
||||||
|
|
||||||
|
- Set the operating directory for `pico`:
|
||||||
|
|
||||||
|
`pico -o {{path/to/directory}}`
|
||||||
|
|
||||||
|
- Enable "view only" mode, which disallows any edits:
|
||||||
|
|
||||||
|
`pico -v {{path/to/file}}`
|
||||||
|
|
||||||
|
- Displays all files including those beginning with a period:
|
||||||
|
|
||||||
|
`pico -a`
|
||||||
29
tldr/pkgz
Normal file
29
tldr/pkgz
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# pkgz
|
||||||
|
|
||||||
|
> Unified package manager for installing, removing, updating, and searching packages from multiple sources.
|
||||||
|
> More information: <https://github.com/roguehashrate/pkgz#-usage>.
|
||||||
|
|
||||||
|
- Install a package:
|
||||||
|
|
||||||
|
`pkgz install {{package_name}}`
|
||||||
|
|
||||||
|
- Remove a package:
|
||||||
|
|
||||||
|
`pkgz remove {{package_name}}`
|
||||||
|
|
||||||
|
- Search for a package:
|
||||||
|
|
||||||
|
`pkgz search {{package_name}}`
|
||||||
|
|
||||||
|
- Update all packages in all sources:
|
||||||
|
|
||||||
|
`pkgz update`
|
||||||
|
|
||||||
|
- Display version:
|
||||||
|
|
||||||
|
`pkgz --version`
|
||||||
30
tldr/pwqgen
Normal file
30
tldr/pwqgen
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# pwqgen
|
||||||
|
|
||||||
|
> Generate a random passphrase.
|
||||||
|
> See also: `libpasswdqc`.
|
||||||
|
> More information: <https://manned.org/pwqgen>.
|
||||||
|
|
||||||
|
- Generate a passphrase:
|
||||||
|
|
||||||
|
`pwqgen`
|
||||||
|
|
||||||
|
- Generate a passphrase with a specific bit size between 24 and 136:
|
||||||
|
|
||||||
|
`pwqgen random={{bitsize}}`
|
||||||
|
|
||||||
|
- Use a config file to control password generation:
|
||||||
|
|
||||||
|
`pwqgen config={{path/to/config_file}}`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`pwqgen {{[-h|--help]}}`
|
||||||
|
|
||||||
|
- Display version:
|
||||||
|
|
||||||
|
`pwqgen --version`
|
||||||
21
tldr/qemu-system-riscv64
Normal file
21
tldr/qemu-system-riscv64
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# qemu-system-riscv64
|
||||||
|
|
||||||
|
> Emulate `riscv64` architecture.
|
||||||
|
> More information: <https://www.qemu.org/docs/master/system/target-riscv.html>.
|
||||||
|
|
||||||
|
- Boot a kernel emulating `riscv64` architecture:
|
||||||
|
|
||||||
|
`qemu-system-riscv64 {{[-M|-machine]}} virt -bios none -kernel {{kernel.elf}} -nographic`
|
||||||
|
|
||||||
|
- List supported machine types:
|
||||||
|
|
||||||
|
`qemu-system-riscv64 {{[-M|-machine]}} help`
|
||||||
|
|
||||||
|
- Exit non-graphical QEMU:
|
||||||
|
|
||||||
|
`<Ctrl a><x>`
|
||||||
23
tldr/rnano
Normal file
23
tldr/rnano
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# rnano
|
||||||
|
|
||||||
|
> A restricted version of `nano`.
|
||||||
|
> Command-line text editor with restricted drive access.
|
||||||
|
> See also: `nano`.
|
||||||
|
> More information: <https://manned.org/rnano>.
|
||||||
|
|
||||||
|
- Start the editor:
|
||||||
|
|
||||||
|
`rnano`
|
||||||
|
|
||||||
|
- Open a specific file:
|
||||||
|
|
||||||
|
`rnano {{path/to/file}}`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`rnano {{[-h|--help]}}`
|
||||||
Reference in New Issue
Block a user