mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-18 03:00:57 +00:00
Update cheatsheets
This commit is contained in:
37
freebsd/cal
Normal file
37
freebsd/cal
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cal
|
||||
|
||||
> Display a calendar with the current day highlighted.
|
||||
> 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:
|
||||
|
||||
`cal -y`
|
||||
|
||||
- Don't [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 [j]ulian days (starting from one, numbered from January 1):
|
||||
|
||||
`cal -j`
|
||||
12
freebsd/chfn
Normal file
12
freebsd/chfn
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# chfn
|
||||
|
||||
> This command is an alias of `chpass`.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr chpass`
|
||||
38
freebsd/chpass
Normal file
38
freebsd/chpass
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
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.freebsd.org/cgi/man.cgi?chpass>.
|
||||
|
||||
- Add or change user database information 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 -s {{path/to/shell}} {{username}}`
|
||||
|
||||
- Change the account [e]xpire time (in seconds from the epoch, UTC):
|
||||
|
||||
`su -c 'chpass -e {{time}} {{username}}'`
|
||||
|
||||
- Change a user's password:
|
||||
|
||||
`su -c 'chpass -p {{encrypted_password}} {{username}}'`
|
||||
|
||||
- Specify the [h]ostname or address of an NIS server to query:
|
||||
|
||||
`su -c 'chpass -h {{hostname}} {{username}}'`
|
||||
|
||||
- Specify a particular NIS [d]omain (system domain name by default):
|
||||
|
||||
`su -c 'chpass -d {{domain}} {{username}}'`
|
||||
12
freebsd/chsh
Normal file
12
freebsd/chsh
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
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
freebsd/df
Normal file
37
freebsd/df
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# df
|
||||
|
||||
> Display an overview of the filesystem disk space usage.
|
||||
> More information: <https://man.freebsd.org/cgi/man.cgi?df>.
|
||||
|
||||
- Display all filesystems and their disk usage using 512-byte units:
|
||||
|
||||
`df`
|
||||
|
||||
- Use [h]uman-readable units (based on powers of 1024) and display a grand total:
|
||||
|
||||
`df -h -c`
|
||||
|
||||
- Use [H]uman-readable units (based on powers of 1000):
|
||||
|
||||
`df -{{-si|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 including the filesystem [T]ypes:
|
||||
|
||||
`df -iT`
|
||||
|
||||
- Use 1024-byte units when writing space figures:
|
||||
|
||||
`df -k`
|
||||
|
||||
- Display information in a [P]ortable way:
|
||||
|
||||
`df -P`
|
||||
26
freebsd/look
Normal file
26
freebsd/look
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# look
|
||||
|
||||
> Display lines beginning with a prefix in a sorted file.
|
||||
> See also: `grep`, `sort`.
|
||||
> More information: <https://man.freebsd.org/cgi/man.cgi?look>.
|
||||
|
||||
- Search for lines beginning with a specific prefix in a specific file:
|
||||
|
||||
`look {{prefix}} {{path/to/file}}`
|
||||
|
||||
- Case-insensitively search only on alphanumeric characters:
|
||||
|
||||
`look -{{f|-ignore-case}} -{{d|-alphanum}} {{prefix}} {{path/to/file}}`
|
||||
|
||||
- Specify a string [t]ermination character (space by default):
|
||||
|
||||
`look -{{t|-terminate}} {{,}}`
|
||||
|
||||
- Search in `/usr/share/dict/words` (`--ignore-case` and `--alphanum` are assumed):
|
||||
|
||||
`look {{prefix}}`
|
||||
33
freebsd/pkg
Normal file
33
freebsd/pkg
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# pkg
|
||||
|
||||
> FreeBSD package manager.
|
||||
> More information: <https://man.freebsd.org/cgi/man.cgi?query=pkg&sektion=8>.
|
||||
|
||||
- Install a new package:
|
||||
|
||||
`pkg install {{package}}`
|
||||
|
||||
- Delete a package:
|
||||
|
||||
`pkg delete {{package}}`
|
||||
|
||||
- Upgrade all packages:
|
||||
|
||||
`pkg upgrade`
|
||||
|
||||
- Search for a package:
|
||||
|
||||
`pkg search {{keyword}}`
|
||||
|
||||
- List installed packages:
|
||||
|
||||
`pkg info`
|
||||
|
||||
- Remove unneeded dependencies:
|
||||
|
||||
`pkg autoremove`
|
||||
34
freebsd/sed
Normal file
34
freebsd/sed
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sed
|
||||
|
||||
> Edit text in a scriptable manner.
|
||||
> See also: `awk`, `ed`.
|
||||
> More information: <https://www.freebsd.org/cgi/man.cgi?sed>.
|
||||
|
||||
- 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}}`
|
||||
41
freebsd/sockstat
Normal file
41
freebsd/sockstat
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# sockstat
|
||||
|
||||
> List open Internet or UNIX domain sockets.
|
||||
> More information: <https://man.freebsd.org/cgi/man.cgi?sockstat>.
|
||||
|
||||
- View which users/processes are [l]istening on which ports:
|
||||
|
||||
`sockstat -l`
|
||||
|
||||
- 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, not resolving [n]umeric UIDs to user names and using a [w]ider field size:
|
||||
|
||||
`sockstat -cnw`
|
||||
|
||||
- Only show sockets that belong to a specific [j]ail ID or name in [v]erbose mode:
|
||||
|
||||
`sockstat -jv`
|
||||
|
||||
- Display the protocol [s]tate and the remote [U]DP encapsulation port number, if applicable (these are currently only implemented for SCTP and TCP):
|
||||
|
||||
`sockstat -sU`
|
||||
|
||||
- Display the [C]ongestion control module and the protocol [S]tack, if applicable (these are currently only implemented for TCP):
|
||||
|
||||
`sockstat -CS`
|
||||
|
||||
- Only show Internet sockets if the local and foreign addresses are not in the loopback network prefix 127.0.0.0/8, or do not contain the IPv6 loopback address ::1:
|
||||
|
||||
`sockstat -L`
|
||||
|
||||
- Do not show the header ([q]uiet mode), showing [u]nix sockets and displaying the `inp_gencnt`:
|
||||
|
||||
`sockstat -qui`
|
||||
12
freebsd/ypchfn
Normal file
12
freebsd/ypchfn
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ypchfn
|
||||
|
||||
> This command is an alias of `chpass`.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr chpass`
|
||||
12
freebsd/ypchpass
Normal file
12
freebsd/ypchpass
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ypchpass
|
||||
|
||||
> This command is an alias of `chpass`.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr chpass`
|
||||
12
freebsd/ypchsh
Normal file
12
freebsd/ypchsh
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ypchsh
|
||||
|
||||
> This command is an alias of `chpass`.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr chpass`
|
||||
Reference in New Issue
Block a user