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

41
netbsd/cal Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, netbsd]
source: https://github.com/tldr-pages/tldr.git
---
# cal
> Display a calendar.
> More information: <https://man.freebsd.org/cgi/man.cgi?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 the whole calendar for the current year using [j]ulian days (one-based, numbered from January 1):
`cal -y -j`
- [h]ighlight today and display [3] months spanning the date:
`cal -h -3 {{month}} {{year}}`
- Display the 2 months [B]efore and 3 [A]fter a specific [m]onth of the current year:
`cal -A 3 -B 2 {{month}}`
- Display a specific number of months before and after ([C]ontext) the specified month:
`cal -C {{months}} {{month}}`
- Specify the starting [d]ay of the week (0: Sunday, 1: Monday, ..., 6: Saturday):
`cal -d {{0..6}}`

12
netbsd/chfn Normal file
View File

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

34
netbsd/chpass Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, netbsd]
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:
`su -c chpass`
- Set a specific login [s]hell for the current user:
`chpass -s {{path/to/shell}}`
- Set a login [s]hell for a specific user:
`chpass chsh -s {{path/to/shell}} {{username}}`
- Specify a user database entry in the `passwd` file format:
`su -c 'chpass -a {{username:encrypted_password:uid:gid:...}} -s {{path/to/file}}' {{username}}`
- Only update the [l]ocal password file:
`su -c 'chpass -l -s {{path/to/shell}}' {{username}}`
- Forcedly change the database [y]P password database entry:
`su -c 'chpass -y -s {{path/to/shell}}' {{username}}`

12
netbsd/chsh Normal file
View File

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

37
netbsd/df Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, netbsd]
source: https://github.com/tldr-pages/tldr.git
---
# df
> Display an overview of the filesystem disk space usage.
> More information: <https://man.netbsd.org/NetBSD-9.3/df.1>.
- Display all filesystems and their disk usage using 512-byte units:
`df`
- Use [h]uman-readable units (based on powers of 1024):
`df -h`
- Display all the fields of the structure(s) returned by `statvfs`:
`df -G`
- 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`

33
netbsd/pkgin Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, netbsd]
source: https://github.com/tldr-pages/tldr.git
---
# pkgin
> Manage `pkgsrc` binary packages on NetBSD.
> More information: <https://pkgin.net/#usage>.
- Install a package:
`pkgin install {{package}}`
- Remove a package and its dependencies:
`pkgin remove {{package}}`
- Upgrade all packages:
`pkgin full-upgrade`
- Search for a package:
`pkgin search {{keyword}}`
- List installed packages:
`pkgin list`
- Remove unneeded dependencies:
`pkgin autoremove`

38
netbsd/sed Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, netbsd]
source: https://github.com/tldr-pages/tldr.git
---
# sed
> Edit text in a scriptable manner.
> See also: `awk`, `ed`.
> More information: <https://man.netbsd.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}}`
- Turn on GNU re[g]ex extension:
`{{command}} | sed -fg {{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}}`

31
netbsd/sockstat Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, netbsd]
source: https://github.com/tldr-pages/tldr.git
---
# sockstat
> List open Internet or UNIX domain sockets.
> Note: this program is a rewrite for NetBSD 3.0 from FreeBSD's `sockstat`.
> See also: `netstat`.
> More information: <https://man.freebsd.org/cgi/man.cgi?sockstat>.
- Show information for IPv4, IPv6 and Unix sockets for both listening and connected sockets:
`sockstat`
- Show information for IPv[4]/IPv[6] sockets [l]istening on specific [p]orts using a specific [P]rotocol:
`sockstat -{{4|6}} -l -P {{tcp|udp|sctp|divert}} -p {{port1,port2...}}`
- Also show [c]onnected sockets, showing [u]nix sockets:
`sockstat -cu`
- Only show [n]umeric output, without resolving symbolic names for addresses and ports:
`sockstat -n`
- Only list sockets of the specified address [f]amily:
`sockstat -f {{inet|inet6|local|unix}}`