Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

37
openbsd/cal Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# cal
> Display a calendar with the current day highlighted.
> More information: <https://man.openbsd.org/cal>.
- Display a calendar for the current month:
`cal`
- Display a calendar for a specific year:
`cal {{year}}`
- Display a calendar for a specific month and year:
`cal {{month}} {{year}}`
- Display a calendar for the current [y]ear:
`cal -y`
- Display [j]ulian days (starting from one, numbered from January 1):
`cal -j`
- Use [m]onday as week start instead of Sunday:
`cal -m`
- Number [w]eek numbers (incompatible with `-j`):
`cal -w`

12
openbsd/chfn Normal file
View File

@@ -0,0 +1,12 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# chfn
> This command is an alias of `chpass`.
- View documentation for the original command:
`tldr chpass`

26
openbsd/chpass Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# chpass
> Add or change user database information, including login shell and password.
> See also: `passwd`.
> More information: <https://man.openbsd.org/chsh>.
- Set a specific login shell for the current user interactively:
`doas chsh`
- Set a specific login [s]hell for the current user:
`doas chsh -s {{path/to/shell}}`
- Set a login [s]hell for a specific user:
`doas chsh -s {{path/to/shell}} {{username}}`
- Specify a user database entry in the `passwd` file format:
`doas chsh -a {{username:encrypted_password:uid:gid:...}}`

12
openbsd/chsh Normal file
View File

@@ -0,0 +1,12 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# chsh
> This command is an alias of `chpass`.
- View documentation for the original command:
`tldr chpass`

33
openbsd/df Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# df
> Display an overview of the filesystem disk space usage.
> More information: <https://man.openbsd.org/df.1>.
- Display all filesystems and their disk usage using 512-byte units:
`df`
- Display all filesystems and their disk usage in [h]uman-readable form (based on powers of 1024):
`df -h`
- Display the filesystem and its disk usage containing the given file or directory:
`df {{path/to/file_or_directory}}`
- Include statistics on the number of free and used [i]nodes:
`df -i`
- Use 1024-byte units when writing space figures:
`df -k`
- Display information in a [P]ortable way:
`df -P`

21
openbsd/pkg Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# pkg
> OpenBSD package manager utility.
> More information: <https://www.openbsd.org/faq/faq15.html>.
- View documentation for installing/updating packages:
`tldr pkg_add`
- View documentation for removing packages:
`tldr pkg_delete`
- View documentation for viewing information about packages:
`tldr pkg_info`

22
openbsd/pkg_add Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# pkg_add
> Install/update packages in OpenBSD.
> See also: `pkg_info`, `pkg_delete`.
> More information: <https://man.openbsd.org/pkg_add>.
- Update all packages, including dependencies:
`pkg_add -u`
- Install a new package:
`pkg_add {{package}}`
- Install packages from the raw output of `pkg_info`:
`pkg_add -l {{path/to/file}}`

22
openbsd/pkg_delete Normal file
View File

@@ -0,0 +1,22 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# pkg_delete
> Remove packages in OpenBSD.
> See also: `pkg_add`, `pkg_info`.
> More information: <https://man.openbsd.org/pkg_delete>.
- Delete a package:
`pkg_delete {{package}}`
- Delete a package, including its unused dependencies:
`pkg_delete -a {{package}}`
- Dry-run deletion of a package:
`pkg_delete -n {{package}}`

18
openbsd/pkg_info Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# pkg_info
> View information about packages in OpenBSD.
> See also: `pkg_add`, `pkg_delete`.
> More information: <https://man.openbsd.org/pkg_info>.
- Search for a package using the package name:
`pkg_info -Q {{package}}`
- Output a list of installed packages for use with `pkg_add -l`:
`pkg_info -mz`

34
openbsd/sed Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, openbsd]
source: https://github.com/tldr-pages/tldr.git
---
# sed
> Edit text in a scriptable manner.
> See also: `awk`, `ed`.
> More information: <https://man.openbsd.org/sed.1>.
- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`:
`{{command}} | sed 's/apple/mango/g'`
- Execute a specific script [f]ile and print the result to `stdout`:
`{{command}} | sed -f {{path/to/script.sed}}`
- Delay opening each file until a command containing the related `w` function or flag is applied to a line of input:
`{{command}} | sed -fa {{path/to/script.sed}}`
- Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`:
`{{command}} | sed -E 's/(apple)/\U\1/g'`
- Print just a first line to `stdout`:
`{{command}} | sed -n '1p'`
- Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a specific file and overwrite the original file in place:
`sed -i 's/apple/mango/g' {{path/to/file}}`