Update cheatsheets

This commit is contained in:
ivuorinen
2025-09-04 00:18:21 +00:00
parent 46b75bdb29
commit 7bb915f683
11 changed files with 192 additions and 17 deletions

32
tldr/linux/gksu Normal file
View File

@@ -0,0 +1,32 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# gksu
> Frontend for `su`.
> Allows you to run graphical commands which need root access without having to run an X terminal emulator.
> Note: This command is deprecated in favor of commands like `pkexec`, and is no longer maintained.
> See also: `gksudo`.
> More information: <https://manned.org/man/gksudo>.
- Run a command as a specific user:
`gksu {{[-u|--user]}} {{userid}} {{command}}`
- Run the command while preserving the current environments:
`gksu {{[-u|--user]}} {{userid}} {{[-k|--preserve-env]}} {{command}}`
- Force `gksu` to use `su` to run the command:
`gksu {{[-u|--user]}} {{userid}} {{[-w|--su-mode]}} {{command}}`
- Force `gksu` to use `sudo` to run the command:
`gksu {{[-u|--user]}} {{userid}} {{[-S|--sudo-mode]}} {{command}}`
- Output debug info for the given command:
`gksu {{[-u|--user]}} {{userid}} {{[-d|--debug]}} {{command}}`

32
tldr/linux/gksudo Normal file
View File

@@ -0,0 +1,32 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# gksudo
> Frontend for `sudo`.
> Allows you to run graphical commands which need root access without having to run an X terminal emulator.
> Note: This command is deprecated in favor of commands like `pkexec`, and is no longer maintained.
> See also: `gksu`.
> More information: <https://manned.org/man/gksudo>.
- Run a command as a specific user:
`gksudo {{[-u|--user]}} {{userid}} {{command}}`
- Run the command while preserving the current environments:
`gksudo {{[-u|--user]}} {{userid}} {{[-k|--preserve-env]}} {{command}}`
- Force `gksudo` to use `su` to run the command:
`gksu {{[-u|--user]}} {{userid}} {{[-w|--su-mode]}} {{command}}`
- Force `gksudo` to use `sudo` to run the command:
`gksudo {{[-u|--user]}} {{userid}} {{[-S|--sudo-mode]}} {{command}}`
- Output debug info for the given command:
`gksudo {{[-u|--user]}} {{userid}} {{[-d|--debug]}} {{command}}`

33
tldr/linux/lvchange Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# lvchange
> Change attributes or the activation state of logical volumes.
> More information: <https://manned.org/lvchange>.
- Activate a logical volume:
`lvchange {{[-a|--activate]}} y {{/dev/vg_name/lv_name}}`
- Deactivate a logical volume:
`lvchange {{[-a|--activate]}} n {{/dev/vg_name/lv_name}}`
- Enable autoactivation for a logical volume:
`lvchange {{[-a|--activate]}} ay {{/dev/vg_name/lv_name}}`
- Set a logical volume to read-only (use `rw` for read-write):
`lvchange {{[-p|--permission]}} r {{/dev/vg_name/lv_name}}`
- Skip activation for a logical volume:
`lvchange {{[-k|--setactivationskip]}} y {{/dev/vg_name/lv_name}}`
- Refresh a logical volume using the latest metadata:
`lvchange --refresh {{/dev/vg_name/lv_name}}`

29
tldr/linux/lvconvert Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# lvconvert
> Convert or modify the type, redundancy, or state of logical volumes.
> More information: <https://manned.org/lvconvert>.
- Convert a linear logical volume to RAID1 (add one mirror: two copies total):
`lvconvert --type raid1 {{[-m|--mirrors]}} 1 {{/dev/vg_name/lv_name}}`
- Remove mirroring and convert back to a linear logical volume:
`lvconvert {{[-m|--mirrors]}} 0 {{/dev/vg_name/lv_name}}`
- Merge a snapshot back into its origin logical volume (applies on next activation):
`lvconvert --merge {{/dev/vg_name/snapshot_lv}}`
- Repair a degraded RAID logical volume:
`lvconvert --repair {{/dev/vg_name/lv_name}}`
- Convert an existing logical volume into a thin pool with a separate metadata LV:
`lvconvert --type thin-pool --poolmetadata {{/dev/vg_name/pool_metadata_lv}} {{/dev/vg_name/pool_lv}}`

View File

@@ -33,7 +33,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo pacman -Syu --overwrite {{path/to/file}}`
- Remove not installed packages and unused repositories from the cache (use the flags `Sc` to [c]lean all packages):
- Remove not installed packages and unused repositories from the cache (use the flags `Scc` to [c]lean all packages):
`sudo pacman -Sc`