mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-28 03:53:45 +00:00
Update cheatsheets
This commit is contained in:
@@ -14,16 +14,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Set the type of an existing reservation to exclusive access:
|
||||
|
||||
`blkpr -c reserve {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} exclusive-access {{path/to/device}}`
|
||||
`blkpr {{[-c|--command]}} reserve {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} exclusive-access {{path/to/device}}`
|
||||
|
||||
- Preempt the existing reservation with a given key and replace it with a new reservation:
|
||||
|
||||
`blkpr -c preempt {{[-K|--oldkey]}} {{old_key}} {{[-k|--key]}} {{new_key}} {{[-t|--type]}} write-exclusive {{path/to/device}}`
|
||||
`blkpr {{[-c|--command]}} preempt {{[-K|--oldkey]}} {{old_key}} {{[-k|--key]}} {{new_key}} {{[-t|--type]}} write-exclusive {{path/to/device}}`
|
||||
|
||||
- Release a reservation with a given key and type on a given device:
|
||||
|
||||
`blkpr -c release {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} {{reservation_type}} {{path/to/device}}`
|
||||
`blkpr {{[-c|--command]}} release {{[-k|--key]}} {{reservation_key}} {{[-t|--type]}} {{reservation_type}} {{path/to/device}}`
|
||||
|
||||
- Clear all reservations from a given device:
|
||||
|
||||
`blkpr -c clear {{[-k|--key]}} {{key}} {{path/to/device}}`
|
||||
`blkpr {{[-c|--command]}} clear {{[-k|--key]}} {{key}} {{path/to/device}}`
|
||||
|
||||
@@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Add UEFI Shell v2 as a boot option:
|
||||
|
||||
`sudo efibootmgr -c -d {{/dev/sda}} -p {{1}} -l "{{\path o\shell.efi}}" -L "{{UEFI Shell}}"`
|
||||
`sudo efibootmgr {{[-c|--create]}} {{[-d|--disk]}} {{/dev/sda}} {{[-p|--part]}} {{1}} {{[-l|--loader]}} "{{\path o\shell.efi}}" {{[-L|--label]}} "{{UEFI Shell}}"`
|
||||
|
||||
- Add Linux as a boot option:
|
||||
|
||||
`sudo efibootmgr --create --disk {{/dev/sda}} --part {{1}} --loader "{{mlinuz}}" --unicode "{{kernel_cmdline}}" --label "{{Linux}}"`
|
||||
`sudo efibootmgr {{[-c|--create]}} {{[-d|--disk]}} {{/dev/sda}} {{[-p|--part]}} {{1}} {{[-l|--loader]}} "{{mlinuz}}" {{[-u|--unicode]}} "{{kernel_cmdline}}" {{[-L|--label]}} "{{Linux}}"`
|
||||
|
||||
- Change the current boot order:
|
||||
|
||||
|
||||
34
tldr/linux/expac
Normal file
34
tldr/linux/expac
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# expac
|
||||
|
||||
> A data extraction tool for alpm databases, offering printf-like flexibility for pacman-based utilities.
|
||||
> See also: `pacman`.
|
||||
> More information: <https://github.com/falconindy/expac>.
|
||||
|
||||
- List the dependencies of a package:
|
||||
|
||||
`expac -S '%D' {{package}}`
|
||||
|
||||
- List the optional dependencies of a package:
|
||||
|
||||
`expac -S "%o" {{package}}`
|
||||
|
||||
- List the download size of packages in MiB:
|
||||
|
||||
`expac -S -H M '%k %n' {{package1 package2 ...}}`
|
||||
|
||||
- List packages marked for upgrade with their download size:
|
||||
|
||||
`expac -S -H M '%k %n' $(pacman -Qqu) | sort -sh`
|
||||
|
||||
- List explicitly-installed packages with their optional dependencies:
|
||||
|
||||
`expac -d '
|
||||
|
||||
' -l '
|
||||
' -Q '%n
|
||||
%O' $(pacman -Qeq)`
|
||||
@@ -18,20 +18,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display a menu of the output of the `ls` command:
|
||||
|
||||
`{{ls}} | fuzzel -d`
|
||||
`{{ls}} | fuzzel {{[-d|--dmenu]}}`
|
||||
|
||||
- Display a menu with custom items separated by a new line (`
|
||||
`):
|
||||
|
||||
`echo -e "{{red}}
|
||||
{{green}}
|
||||
{{blue}}" | fuzzel -d`
|
||||
{{blue}}" | fuzzel {{[-d|--dmenu]}}`
|
||||
|
||||
- Let the user choose between multiple items and save the selected one to a file:
|
||||
|
||||
`echo -e "{{red}}
|
||||
{{green}}
|
||||
{{blue}}" | fuzzel -d > {{color.txt}}`
|
||||
{{blue}}" | fuzzel {{[-d|--dmenu]}} > {{color.txt}}`
|
||||
|
||||
- Reset apps usage count (default cache directory: `$XDG_CACHE_HOME/fuzzel`):
|
||||
|
||||
@@ -39,8 +39,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Launch `fuzzel` on a specific monitor, see `wlr-randr` or `swaymsg -t get_outputs`:
|
||||
|
||||
`fuzzel -o "{{DP-1}}"`
|
||||
`fuzzel {{[-o|--output]}} "{{DP-1}}"`
|
||||
|
||||
- Use `fuzzel` to do an online search:
|
||||
|
||||
`fuzzel -d -l 0 --placeholder "{{Type your search}}" | sed 's/^/\"/g;s/$/\"/g' | xargs firefox --search`
|
||||
`fuzzel {{[-d|--dmenu]}} {{[-l|--lines]}} 0 --placeholder "{{Type your search}}" | sed 's/^/\"/g;s/$/\"/g' | xargs firefox --search`
|
||||
|
||||
21
tldr/linux/lxc-console
Normal file
21
tldr/linux/lxc-console
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# lxc-console
|
||||
|
||||
> Attach to a container.
|
||||
> More information: <https://linuxcontainers.org/lxc/manpages//man1/lxc-console.1.html>.
|
||||
|
||||
- Start a console in a container:
|
||||
|
||||
`agetty {{[-L|--local-line]}} {{38400}} tty1`
|
||||
|
||||
- Connect to an lxc console:
|
||||
|
||||
`sudo lxc-console {{container_name}}`
|
||||
|
||||
- Exit `lxc-console`:
|
||||
|
||||
`<Ctrl a><q>`
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create a container interactively in `/var/lib/lxc/`:
|
||||
|
||||
`sudo lxc-create {{[-n|--name]}} {{container}} {{[-t|--template]}} download`
|
||||
`sudo lxc-create {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download`
|
||||
|
||||
- Create a container in a target directory:
|
||||
|
||||
`sudo lxc-create {{[-P|--lxcpath]}} {{/path/to/directory/}} {{[-n|--name]}} {{container}} {{[-t|--template]}} download`
|
||||
`sudo lxc-create {{[-P|--lxcpath]}} {{/path/to/directory/}} {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download`
|
||||
|
||||
- Create a container passing options to a template:
|
||||
|
||||
`sudo lxc-create {{[-n|--name]}} {{name}} {{[-t|--template]}} download -- {{[-d|--dist]}} {{distro-name}} {{[-r|--release]}} {{release-version}} {{[-a|--arch]}} {{arch}}`
|
||||
`sudo lxc-create {{[-n|--name]}} {{container_name}} {{[-t|--template]}} download -- {{[-d|--dist]}} {{distro-name}} {{[-r|--release]}} {{release-version}} {{[-a|--arch]}} {{arch}}`
|
||||
|
||||
@@ -8,6 +8,18 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Start a container.
|
||||
> More information: <https://linuxcontainers.org/lxc/getting-started/>.
|
||||
|
||||
- Start the lxc service:
|
||||
|
||||
`systemctl start lxc-net`
|
||||
|
||||
- Start a container:
|
||||
|
||||
`sudo lxc-start {{container_name}}`
|
||||
|
||||
- Start a container in the foreground:
|
||||
|
||||
`sudo lxc-start {{container_name}} {{[-F|--foreground]]}`
|
||||
|
||||
- Exit out of a foreground container (run this in a separate terminal):
|
||||
|
||||
`sudo lxc-stop {{container_name}}`
|
||||
|
||||
@@ -17,17 +17,17 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`pw-dot {{[-j|--json]}} {{path/to/file.json}}`
|
||||
|
||||
- Specify an [o]utput file, showing all object types:
|
||||
- Specify an output file, showing all object types:
|
||||
|
||||
`pw-dot --output {{path/to/file.dot}} {{[-a|--all]}}`
|
||||
`pw-dot {{[-o|--output]}} {{path/to/file.dot}} {{[-a|--all]}}`
|
||||
|
||||
- Print `.dot` graph to `stdout`, showing all object properties:
|
||||
|
||||
`pw-dot --output - {{[-d|--detail]}}`
|
||||
`pw-dot {{[-o|--output]}} - {{[-d|--detail]}}`
|
||||
|
||||
- Generate a graph from a [r]emote instance, showing only linked objects:
|
||||
- Generate a graph from a remote instance, showing only linked objects:
|
||||
|
||||
`pw-dot --remote {{remote_name}} {{[-s|--smart]}}`
|
||||
`pw-dot {{[-r|--remote]}} {{remote_name}} {{[-s|--smart]}}`
|
||||
|
||||
- Lay the graph from left to right, instead of dot's default top to bottom:
|
||||
|
||||
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display help:
|
||||
|
||||
`pw-dot --help`
|
||||
`pw-dot {{[-h|--help]}}`
|
||||
|
||||
@@ -31,8 +31,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Set `log.level` to 1 in `settings`:
|
||||
|
||||
`pw-metadata --name {{settings}} {{0}} {{log.level}} {{1}}`
|
||||
`pw-metadata {{[-n|--name]}} {{settings}} {{0}} {{log.level}} {{1}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`pw-metadata --help`
|
||||
`pw-metadata {{[-h|--help]}}`
|
||||
|
||||
@@ -14,6 +14,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`sudo semanage permissive {{[-l|--list]}}`
|
||||
|
||||
- Set or unset permissive mode for a domain:
|
||||
- Set permissive mode for a domain:
|
||||
|
||||
`sudo semanage permissive {{-a|--add|-d|--delete}} {{httpd_t}}`
|
||||
`sudo semanage permissive {{[-a|--add]}} {{httpd_t}}`
|
||||
|
||||
- Unset permissive mode for a domain:
|
||||
|
||||
`sudo semanage permissive {{[-d|--delete]}} {{httpd_t}}`
|
||||
|
||||
Reference in New Issue
Block a user