Update cheatsheets

This commit is contained in:
ivuorinen
2025-12-08 00:21:51 +00:00
parent 22bb163ffa
commit 4bbaaf8836
16 changed files with 164 additions and 11 deletions

2
tldr/!
View File

@@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git
`!{{string}}`
- Substitute with the arguments of the latest command:
- Substitute with all of the arguments of the latest command:
`{{command}} !*`

2
tldr/$
View File

@@ -28,7 +28,7 @@ source: https://github.com/tldr-pages/tldr.git
`echo ${{PS0|PS1|PS2|PS3|PS4}}`
- Expand with the output of `command` and run it. Same as enclosing `command` in backtics:
- Expand with the output of `command` and run it. Same as enclosing `command` in backticks:
`$({{command}})`

12
tldr/bun-list Normal file
View File

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

17
tldr/bun-pm-bin Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# bun pm bin
> Display the path to `bin` directories.
> More information: <https://bun.com/docs/pm/cli/pm#bin>.
- Get the path to the local project's `bin` directory:
`bun pm bin`
- Get the path to the global `bin` directory:
`bun pm bin {{[-g|--global]}}`

17
tldr/bun-pm-ls Normal file
View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# bun pm ls
> List installed dependencies and their versions.
> More information: <https://bun.com/docs/pm/cli/pm#ls>.
- List dependencies in the current project:
`bun pm {{[ls|list]}}`
- List all transitive dependencies:
`bun pm {{[ls|list]}} {{[-a|--all]}}`

View File

@@ -27,7 +27,7 @@ source: https://github.com/tldr-pages/tldr.git
- Create a system backup, save it into an IMG file (can be restored later by swapping `if` and `of`), and show the progress:
`dd if={{/dev/drive_device}} of={{path/to/file.img}} status=progress`
`sudo dd if={{/dev/drive_device}} of={{path/to/file.img}} status=progress`
- Check the progress of an ongoing `dd` operation (run this command from another shell):

View File

@@ -12,9 +12,9 @@ source: https://github.com/tldr-pages/tldr.git
`sudo envycontrol {{[-s|--switch]}} {{nvidia|integrated|hybrid}}`
- Specify your display manager manually:
- Specify your [d]isplay [m]anager manually:
`envycontrol --dm`
`envycontrol --dm {{gdm|gdm3|sddm|lightdm}}`
- Check current GPU mode:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# head
> Output the first part of files.
> See also: `tail`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html>.
- Show first 10 lines in a file:

View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# Natural Selection 2
> Start a headless Natural Selection 2 server.
> More information: <https://naturalselection.fandom.com/wiki/Dedicated_Server>.
- Start a server with the default settings:
`{{path/to/server_linux}}`
- Give a server a custom name that shows in the server browser:
`{{path/to/server_linux}} -name '{{server_name}}'`
- Specify a connection port for the server:
`{{path/to/server_linux}} -port {{27015}}`
- Specify maximum player count:
`{{path/to/server_linux}} -limit {{2..24}}`
- Specify the initial map the server starts on:
`{{path/to/server_linux}} -map {{ns2_summit}}`
- Limit access to the server with a password:
`{{path/to/server_linux}} -password {{password}}`
- Start a server with webui admin interface:
`{{path/to/server_linux}} -webadmin -webport {{8080}}`

View File

@@ -23,3 +23,11 @@ source: https://github.com/tldr-pages/tldr.git
- Execute a specific command after 20 [m]inutes delay:
`sleep 20m && {{command}}`
- Delay forever:
`sleep {{[inf|infinity]}}`
- Display help:
`sleep --help`

View File

@@ -12,6 +12,10 @@ source: https://github.com/tldr-pages/tldr.git
`ln {{[-s|--symbolic]}} /{{path/to/file_or_directory}} {{path/to/symlink}}`
- Create a symbolic link relative to where the link is located:
`ln {{[-s|--symbolic]}} {{path/to/file_or_directory}} {{path/to/symlink}}`
- Overwrite an existing symbolic link to point to a different file:
`ln {{[-sf|--symbolic --force]}} /{{path/to/new_file}} {{path/to/symlink}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# head
> Output the first part of files.
> See also: `tail`.
> More information: <https://keith.github.io/xcode-man-pages/head.1.html>.
- Output the first 10 lines of a file:

View File

@@ -24,13 +24,13 @@ source: https://github.com/tldr-pages/tldr.git
`sort {{[-n|--numeric-sort]}} {{path/to/file}}`
- Sort `/etc/passwd` by the 3rd field of each line numerically, using ":" as a field separator:
- Sort `/etc/passwd` by the 3rd field of each line numerically, using `:` as a field separator:
`sort {{[-t|--field-separator]}} {{:}} {{[-k|--key]}} {{3n}} {{/etc/passwd}}`
`sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3n /etc/passwd`
- As above, but when items in the 3rd field are equal, sort by the 4th field by numbers with exponents:
`sort {{[-t|--field-separator]}} {{:}} {{[-k|--key]}} {{3,3n}} {{[-k|--key]}} {{4,4g}} {{/etc/passwd}}`
`sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3,3n {{[-k|--key]}} 4,4g /etc/passwd`
- Sort a file preserving only unique lines:
@@ -38,4 +38,4 @@ source: https://github.com/tldr-pages/tldr.git
- Sort a file, printing the output to the specified output file (can be used to sort a file in-place):
`sort {{[-o|--output]}} {{path/to/file}} {{path/to/file}}`
`sort {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}`

View File

@@ -17,9 +17,9 @@ source: https://github.com/tldr-pages/tldr.git
`tail {{path/to/file1 path/to/file2 ...}}`
- Show last `count` lines in file:
- Show last 5 lines in file:
`tail {{[-n|--lines]}} {{count}} {{path/to/file}}`
`tail {{[-5|--lines 5]}} {{path/to/file}}`
- Print a file from a specific line number:

38
tldr/vagrant-init Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant init
> Initialize a Vagrant environment in the current directory by creating a `Vagrantfile`.
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/init>.
- Create a `Vagrantfile`:
`vagrant init`
- Create a `Vagrantfile` without instructional comments:
`vagrant init {{[-m|--minimal]}}`
- Specify the box name and URL:
`vagrant init {{box_name}} {{box_url}}`
- Create a `Vagrantfile` with a specific box version:
`vagrant init --box-version {{version}} {{box_name}}`
- Send the `Vagrantfile` to `stdout`:
`vagrant init {{[-o|--output]}} -`
- Overwrite an existing `Vagrantfile`:
`vagrant init {{[-f|--force]}}`
- Provide a custom ERB template for generating the `Vagrantfile`:
`vagrant init --template {{path/to/file.erb}}`

18
tldr/vagrant-ssh-config Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# vagrant ssh-config
> Display configuration to SSH into a Vagrant machine manually (instead of using `vagrant ssh`).
> See also: `vagrant`.
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/ssh_config>.
- Get SSH configuration for the machine running in the current directory:
`vagrant ssh-config`
- Target a machine by name or ID:
`vagrant ssh-config {{name|id}}`