mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-06 01:56:03 +00:00
Update cheatsheets
This commit is contained in:
33
tldr/aider
Normal file
33
tldr/aider
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# aider
|
||||||
|
|
||||||
|
> Pair program with the LLM of your choice.
|
||||||
|
> More information: <https://github.com/Aider-AI/aider>.
|
||||||
|
|
||||||
|
- Start a new project or work with an existing code base:
|
||||||
|
|
||||||
|
`aider --model {{model_name}} --api-key {{your_api_key}}`
|
||||||
|
|
||||||
|
- Add new features or test cases to specific files:
|
||||||
|
|
||||||
|
`aider {{path/to/file1 path/to/file2 ...}}`
|
||||||
|
|
||||||
|
- Describe a bug and let `aider` fix it:
|
||||||
|
|
||||||
|
`aider {{path/to/file}} --describe "{{bug_description}}"`
|
||||||
|
|
||||||
|
- Refactor code in a specific file:
|
||||||
|
|
||||||
|
`aider {{path/to/file}} --refactor`
|
||||||
|
|
||||||
|
- Update documentation:
|
||||||
|
|
||||||
|
`aider {{path/to/file}} --update-docs`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`aider --help`
|
||||||
2
tldr/cut
2
tldr/cut
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
- Print a [f]ield range of each line with a specific [d]elimiter:
|
- Print a [f]ield range of each line with a specific [d]elimiter:
|
||||||
|
|
||||||
`{{command}} | cut --delimiter "{{,}}" --fields {{1}}`
|
`{{command}} | cut --delimiter "{{delimiter}}" --fields {{1|1,10|1-10|1-|-10}}`
|
||||||
|
|
||||||
- Print a [c]haracter range of each line of the specific file:
|
- Print a [c]haracter range of each line of the specific file:
|
||||||
|
|
||||||
|
|||||||
21
tldr/dtrx
Normal file
21
tldr/dtrx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# dtrx
|
||||||
|
|
||||||
|
> "Do The Right eXtraction" - extract any archive into new directory by guessing the tool from extension.
|
||||||
|
> More information: <https://github.com/dtrx-py/dtrx>.
|
||||||
|
|
||||||
|
- Extract archive, guessing the extraction tool from extension:
|
||||||
|
|
||||||
|
`dtrx {{path/to/file}}`
|
||||||
|
|
||||||
|
- Extract archive, overwrite any existing target output:
|
||||||
|
|
||||||
|
`dtrx --overwrite {{path/to/file}}`
|
||||||
|
|
||||||
|
- Extract archive, put everything into current directory:
|
||||||
|
|
||||||
|
`dtrx --flat {{path/to/file}}`
|
||||||
17
tldr/img2sixel
Normal file
17
tldr/img2sixel
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# img2sixel
|
||||||
|
|
||||||
|
> Convert images to the Sixel format for displaying in a terminal.
|
||||||
|
> More information: <https://manned.org/img2sixel>.
|
||||||
|
|
||||||
|
- Display an image in the terminal:
|
||||||
|
|
||||||
|
`img2sixel {{path/to/image}}`
|
||||||
|
|
||||||
|
- Resize the image to the specified width and height before displaying it:
|
||||||
|
|
||||||
|
`img2sixel {{-w|--width}} {{number}} {{-h|--height}} {{number}} {{path/to/image}}`
|
||||||
17
tldr/linux/bwrap
Normal file
17
tldr/linux/bwrap
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# bwrap
|
||||||
|
|
||||||
|
> Run programs in a lightweight sandbox.
|
||||||
|
> More information: <https://manned.org/bwrap>.
|
||||||
|
|
||||||
|
- Run a program in a read-only environment:
|
||||||
|
|
||||||
|
`bwrap --ro-bind / / {{/bin/bash}}`
|
||||||
|
|
||||||
|
- Give the environment access to devices, process information and create a `tmpfs` for it:
|
||||||
|
|
||||||
|
`bwrap --dev-bind /dev /dev --proc /proc --ro-bind / / --tmpfs /tmp {{/bin/bash}}`
|
||||||
21
tldr/linux/eglinfo
Normal file
21
tldr/linux/eglinfo
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# eglinfo
|
||||||
|
|
||||||
|
> Display platform EGL information.
|
||||||
|
> More information: <https://github.com/dv1/eglinfo>.
|
||||||
|
|
||||||
|
- Display full platform information:
|
||||||
|
|
||||||
|
`eglinfo`
|
||||||
|
|
||||||
|
- Display a brief version of platform information:
|
||||||
|
|
||||||
|
`eglinfo -B`
|
||||||
|
|
||||||
|
- Display help:
|
||||||
|
|
||||||
|
`eglinfo -h`
|
||||||
13
tldr/linux/ifstatus
Normal file
13
tldr/linux/ifstatus
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# ifstatus
|
||||||
|
|
||||||
|
> Display OpenWRT interface status in JSON format.
|
||||||
|
> More information: <https://openwrt.org/docs/techref/netifd>.
|
||||||
|
|
||||||
|
- Display interface status:
|
||||||
|
|
||||||
|
`ifstatus {{interface_name}}`
|
||||||
25
tldr/linux/logread
Normal file
25
tldr/linux/logread
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, linux]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# logread
|
||||||
|
|
||||||
|
> Read the `logd` ring buffer log.
|
||||||
|
> More information: <https://openwrt.org/docs/guide-user/base-system/log.essentials>.
|
||||||
|
|
||||||
|
- Print the log:
|
||||||
|
|
||||||
|
`logread`
|
||||||
|
|
||||||
|
- Print a specified number of messages:
|
||||||
|
|
||||||
|
`logread -l {{N}}`
|
||||||
|
|
||||||
|
- Filter messages by (Keyword/Regular Expression):
|
||||||
|
|
||||||
|
`logread -e {{pattern}}`
|
||||||
|
|
||||||
|
- Print log messages as they happen:
|
||||||
|
|
||||||
|
`logread -f`
|
||||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
- List the commands and the names of the expected events:
|
- List the commands and the names of the expected events:
|
||||||
|
|
||||||
`trap -p`
|
`trap`
|
||||||
|
|
||||||
- Execute a command when a signal is received:
|
- Execute a command when a signal is received:
|
||||||
|
|
||||||
@@ -23,3 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
- Remove commands:
|
- Remove commands:
|
||||||
|
|
||||||
`trap - {{SIGHUP}} {{SIGINT}}`
|
`trap - {{SIGHUP}} {{SIGINT}}`
|
||||||
|
|
||||||
|
- Ignore a signal:
|
||||||
|
|
||||||
|
`trap '' {{SIGINT}}`
|
||||||
|
|||||||
12
tldr/rails
12
tldr/rails
@@ -13,6 +13,18 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
`rails new "{{project_name}}"`
|
`rails new "{{project_name}}"`
|
||||||
|
|
||||||
|
- Generate a scaffold for a model named Post, predefining the attributes title and body:
|
||||||
|
|
||||||
|
`rails generate scaffold Post title:string body:text`
|
||||||
|
|
||||||
|
- Run migrations:
|
||||||
|
|
||||||
|
`rails db:migrate`
|
||||||
|
|
||||||
|
- List all routes:
|
||||||
|
|
||||||
|
`rails routes`
|
||||||
|
|
||||||
- Start local server for current project on port 3000:
|
- Start local server for current project on port 3000:
|
||||||
|
|
||||||
`rails server`
|
`rails server`
|
||||||
|
|||||||
17
tldr/snmpget
Normal file
17
tldr/snmpget
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# snmpget
|
||||||
|
|
||||||
|
> Query using the SNMP protocol.
|
||||||
|
> More information: <https://manned.org/snmpget>.
|
||||||
|
|
||||||
|
- Request a single value from the SNMP agent:
|
||||||
|
|
||||||
|
`snmpget -v {{version}} -c {{community}} {{ip}} {{oid}}`
|
||||||
|
|
||||||
|
- Display the full Object Identifier (OID) path:
|
||||||
|
|
||||||
|
`snmpget -v {{version}} -c {{community}} -O f {{ip}} {{oid}}`
|
||||||
29
tldr/snmpwalk
Normal file
29
tldr/snmpwalk
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# snmpwalk
|
||||||
|
|
||||||
|
> SNMP query tool.
|
||||||
|
> More information: <https://manned.org/snmpwalk>.
|
||||||
|
|
||||||
|
- Query the system information of a remote host using SNMPv1 and a community string:
|
||||||
|
|
||||||
|
`snmpwalk -v 1 -c {{community}} {{ip}}`
|
||||||
|
|
||||||
|
- Query system information on a remote host by OID using SNMPv2 on a specified port:
|
||||||
|
|
||||||
|
`snmpwalk -v 2c -c {{community}} {{ip}}:{{port}} {{oid}}`
|
||||||
|
|
||||||
|
- Query system information on a remote host by OID using SNMPv3 and authentication without encryption:
|
||||||
|
|
||||||
|
`snmpwalk -v 3 -l {{authNoPriv}} -u {{username}} -a {{MD5|SHA}} -A {{passphrase}} {{ip}} {{oid}}`
|
||||||
|
|
||||||
|
- Query system information on a remote host by OID using SNMPv3, authentication, and encryption:
|
||||||
|
|
||||||
|
`snmpwalk -v 3 -l {{authPriv}} -u {{username}} -a {{MD5|SHA}} -A {{auth_passphrase}} -x {{DES|AES}} -X {{enc_passphrase}} {{ip}} {{oid}}`
|
||||||
|
|
||||||
|
- Query system information on a remote host by OID using SNMPv3 without authentication or encryption:
|
||||||
|
|
||||||
|
`snmpwalk -v 3 -l {{noAuthNoPriv}} -u {{username}} {{ip}} {{oid}}`
|
||||||
34
tldr/vagrant-plugin
Normal file
34
tldr/vagrant-plugin
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# vagrant plugin
|
||||||
|
|
||||||
|
> Manage Vagrant plugins.
|
||||||
|
> See also: `vagrant`.
|
||||||
|
> More information: <https://developer.hashicorp.com/vagrant/docs/cli/plugin>.
|
||||||
|
|
||||||
|
- List all the plugins currently installed:
|
||||||
|
|
||||||
|
`vagrant plugin list`
|
||||||
|
|
||||||
|
- Install a plugin from remote repositories, usually RubyGems:
|
||||||
|
|
||||||
|
`vagrant plugin install {{vagrant_vbguest}}`
|
||||||
|
|
||||||
|
- Install a plugin from a local file source:
|
||||||
|
|
||||||
|
`vagrant plugin install {{path/to/my_plugin.gem}}`
|
||||||
|
|
||||||
|
- Update all installed plugins to their latest version:
|
||||||
|
|
||||||
|
`vagrant plugin update`
|
||||||
|
|
||||||
|
- Update a plugin to the latest version:
|
||||||
|
|
||||||
|
`vagrant plugin update {{vagrant_vbguest}}`
|
||||||
|
|
||||||
|
- Uninstall a specific plugin:
|
||||||
|
|
||||||
|
`vagrant uninstall {{vagrant_vbguest}}`
|
||||||
@@ -12,14 +12,18 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
`virt-sysprep --list-operations`
|
`virt-sysprep --list-operations`
|
||||||
|
|
||||||
- Run all enabled operations but don't actually apply the changes:
|
- Remove sensitive system data from a virtual machine image:
|
||||||
|
|
||||||
`virt-sysprep --domain {{vm_name}} --dry-run`
|
`sudo virt-sysprep --add {{path/to/image.qcow2}}`
|
||||||
|
|
||||||
|
- Specify a virtual machine by its name and run all enabled operations but don't actually apply the changes:
|
||||||
|
|
||||||
|
`sudo virt-sysprep --domain {{vm_name}} --dry-run`
|
||||||
|
|
||||||
- Run only the specified operations:
|
- Run only the specified operations:
|
||||||
|
|
||||||
`virt-sysprep --domain {{vm_name}} --operations {{operation1,operation2,...}}`
|
`sudo virt-sysprep --domain {{vm_name}} --operations {{operation1,operation2,...}}`
|
||||||
|
|
||||||
- Generate a new `/etc/machine-id` file and enable customizations to be able to change the host name to avoid network conflicts:
|
- Generate a new `/etc/machine-id` file and enable customizations to be able to change the host name to avoid network conflicts:
|
||||||
|
|
||||||
`virt-sysprep --domain {{vm_name}} --enable {{customizations}} --hostname {{host_name}} --operation {{machine-id}}`
|
`sudo virt-sysprep --domain {{vm_name}} --enable {{customizations}} --hostname {{host_name}} --operation {{machine-id}}`
|
||||||
|
|||||||
18
tldr/watch
18
tldr/watch
@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
---
|
---
|
||||||
# watch
|
# watch
|
||||||
|
|
||||||
> Execute a program periodically, showing output fullscreen.
|
> Execute a program periodically and monitor the output in full-screen mode.
|
||||||
> More information: <https://manned.org/watch>.
|
> More information: <https://manned.org/watch>.
|
||||||
|
|
||||||
- Repeatedly run a command and show the result:
|
- Repeatedly run a command and show the result:
|
||||||
@@ -14,12 +14,20 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
|
|
||||||
- Re-run a command every 60 seconds:
|
- Re-run a command every 60 seconds:
|
||||||
|
|
||||||
`watch -n {{60}} {{command}}`
|
`watch --interval {{60}} {{command}}`
|
||||||
|
|
||||||
- Monitor the contents of a directory, highlighting differences as they appear:
|
- Monitor disk space, highlighting differences as they appear:
|
||||||
|
|
||||||
`watch -d {{ls -l}}`
|
`watch --differences {{df}}`
|
||||||
|
|
||||||
- Repeatedly run a pipeline and show the result:
|
- Repeatedly run a pipeline and show the result:
|
||||||
|
|
||||||
`watch '{{command_1}} | {{command_2}} | {{command_3}}'`
|
`watch "{{command_1}} | {{command_2}} | {{command_3}}"`
|
||||||
|
|
||||||
|
- Exit `watch` if the visible output changes:
|
||||||
|
|
||||||
|
`watch --chgexit {{lsblk}}`
|
||||||
|
|
||||||
|
- Interpret terminal control characters:
|
||||||
|
|
||||||
|
`watch --color {{ls --color=always}}`
|
||||||
|
|||||||
42
tldr/windows/es
Normal file
42
tldr/windows/es
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, windows]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# es
|
||||||
|
|
||||||
|
> Command-line interface for Everything, a fast file and folder search tool for Windows.
|
||||||
|
> Requires Everything to be installed and running in the background.
|
||||||
|
> More information: <https://www.voidtools.com/support/everything/command_line_interface/>.
|
||||||
|
|
||||||
|
- Search for a file or folder by name:
|
||||||
|
|
||||||
|
`es {{search_term}}`
|
||||||
|
|
||||||
|
- Search using a regular expression:
|
||||||
|
|
||||||
|
`es -r {{regex_pattern}}`
|
||||||
|
|
||||||
|
- Match whole words:
|
||||||
|
|
||||||
|
`es -w {{search_term}}`
|
||||||
|
|
||||||
|
- Limit the number of results shown:
|
||||||
|
|
||||||
|
`es -n {{10}} {{search_term}}`
|
||||||
|
|
||||||
|
- Search within a specific folder:
|
||||||
|
|
||||||
|
`es -path {{folder_path}} {{search_term}}`
|
||||||
|
|
||||||
|
- List folders only:
|
||||||
|
|
||||||
|
`es /ad`
|
||||||
|
|
||||||
|
- List files only:
|
||||||
|
|
||||||
|
`es /a-d`
|
||||||
|
|
||||||
|
- Sort results (e.g., by name):
|
||||||
|
|
||||||
|
`es -sort {{name-ascending}}`
|
||||||
Reference in New Issue
Block a user