mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
Update cheatsheets
This commit is contained in:
@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Create aliases - words that are replaced by a command string.
|
||||
> Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. `~/.bashrc` for Bash or `~/.zshrc` for Zsh.
|
||||
> See also: `unalias`.
|
||||
> More information: <https://manned.org/alias>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-alias>.
|
||||
|
||||
- List all aliases:
|
||||
|
||||
|
||||
2
tldr/bg
2
tldr/bg
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Resume suspended jobs (e.g. using `<Ctrl z>`), and keeps them running in the background.
|
||||
> See also: `jobs`, `fg`, `disown`.
|
||||
> More information: <https://manned.org/bg>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-bg>.
|
||||
|
||||
- Resume the most recently suspended job and run it in the background:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# builtin
|
||||
|
||||
> Execute shell builtins.
|
||||
> More information: <https://manned.org/builtin.1>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-builtin>.
|
||||
|
||||
- Run a shell builtin:
|
||||
|
||||
|
||||
2
tldr/cd
2
tldr/cd
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# cd
|
||||
|
||||
> Change the current working directory.
|
||||
> More information: <https://manned.org/cd>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-cd>.
|
||||
|
||||
- Go to the specified directory:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# Colon
|
||||
|
||||
> Returns a successful exit status code of 0.
|
||||
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#colon>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-_003a>.
|
||||
|
||||
- Return a successful exit code:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# command
|
||||
|
||||
> Command forces the shell to execute the program and ignore any functions, builtins and aliases with the same name.
|
||||
> More information: <https://manned.org/command>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-command>.
|
||||
|
||||
- Execute the `ls` program literally, even if an `ls` alias exists:
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`conda info {{[-e|--envs]}}`
|
||||
|
||||
- Load an environment:
|
||||
- Activate an environment:
|
||||
|
||||
`conda activate {{environment_name}}`
|
||||
|
||||
- Unload an environment:
|
||||
- Deactivate an environment:
|
||||
|
||||
`conda deactivate`
|
||||
|
||||
|
||||
37
tldr/conda-env
Normal file
37
tldr/conda-env
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# conda env
|
||||
|
||||
> Manage conda environments.
|
||||
> More information: <https://docs.conda.io/projects/conda/en/latest/commands/env/index.html>.
|
||||
|
||||
- Create an environment from an environment file (YAML, TXT, etc.):
|
||||
|
||||
`conda env create {{[-f|--file]}} {{path/to/file}}`
|
||||
|
||||
- Delete an environment and everything in it:
|
||||
|
||||
`conda env remove {{[-n|--name]}} {{environment_name}}`
|
||||
|
||||
- Update an environment based on an environment file:
|
||||
|
||||
`conda env update {{[-f|--file]}} {{path/to/file}} --prune`
|
||||
|
||||
- List all environments:
|
||||
|
||||
`conda env list`
|
||||
|
||||
- View environment details:
|
||||
|
||||
`conda env export`
|
||||
|
||||
- List environment variables:
|
||||
|
||||
`conda env config vars list`
|
||||
|
||||
- Set environment variables:
|
||||
|
||||
`conda env config vars set {{my_var}}={{value}}`
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# eval
|
||||
|
||||
> Execute arguments as a single command in the current shell and return its result.
|
||||
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#eval>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-eval>.
|
||||
|
||||
- Call `echo` with the "foo" argument:
|
||||
|
||||
|
||||
2
tldr/fc
2
tldr/fc
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# fc
|
||||
|
||||
> Open the most recent command for editing and then run it.
|
||||
> More information: <https://manned.org/fc>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-fc>.
|
||||
|
||||
- Open the last command in the default system editor and run it after editing:
|
||||
|
||||
|
||||
2
tldr/fg
2
tldr/fg
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Run jobs in foreground.
|
||||
> See also: `jobs`, `bg`, `disown`.
|
||||
> More information: <https://manned.org/fg>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-fg>.
|
||||
|
||||
- Bring most recently suspended or running background job to foreground:
|
||||
|
||||
|
||||
33
tldr/kubectl-api-resources
Normal file
33
tldr/kubectl-api-resources
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# kubectl api-resources
|
||||
|
||||
> Print the supported API resources on the server.
|
||||
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#api-resources>.
|
||||
|
||||
- Print the supported API resources:
|
||||
|
||||
`kubectl api-resources`
|
||||
|
||||
- Print the supported API resources with more information:
|
||||
|
||||
`kubectl api-resources {{[-o|--output]}} wide`
|
||||
|
||||
- Print the supported API resources sorted by a column:
|
||||
|
||||
`kubectl api-resources --sort-by {{name}}`
|
||||
|
||||
- Print the supported namespaced resources:
|
||||
|
||||
`kubectl api-resources --namespaced`
|
||||
|
||||
- Print the supported non-namespaced resources:
|
||||
|
||||
`kubectl api-resources --namespaced=false`
|
||||
|
||||
- Print the supported API resources with a specific API group:
|
||||
|
||||
`kubectl api-resources --api-group={{api_group}}`
|
||||
17
tldr/kubectl-autoscale
Normal file
17
tldr/kubectl-autoscale
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# kubectl autoscale
|
||||
|
||||
> Create an autoscaler to intelligently scale pod count based on kubernetes cluster demands.
|
||||
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#autoscale>.
|
||||
|
||||
- Auto scale a deployment with no target CPU utilization specified:
|
||||
|
||||
`kubectl autoscale {{[deploy|deployment]}} {{deployment_name}} --min={{min_replicas}} --max={{max_replicas}}`
|
||||
|
||||
- Auto scale a deployment with target CPU utilization:
|
||||
|
||||
`kubectl autoscale {{[deploy|deployment]}} {{deployment_name}} --max={{max_replicas}} --cpu-percent={{target_cpu}}`
|
||||
2
tldr/let
2
tldr/let
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Evaluate arithmetic expressions in shell.
|
||||
> Supports variables, operators, and conditional expressions.
|
||||
> More information: <https://manned.org/let>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-let>.
|
||||
|
||||
- Evaluate a simple arithmetic expression:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# collectd
|
||||
|
||||
> System statistics collection daemon.
|
||||
> More information: <https://www.collectd.org/documentation/>.
|
||||
> More information: <https://manned.org/collectd>.
|
||||
|
||||
- Test the configuration file and then exit:
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`sudo e2fsck -c {{/dev/sdXN}}`
|
||||
|
||||
- Force checking even if the filesystem seems clean:
|
||||
|
||||
`sudo e2fsck -f {{/dev/sdXN}}`
|
||||
|
||||
- Perform an exhaustive, non-destructive read-write test for bad blocks and blacklist them:
|
||||
|
||||
`sudo e2fsck -fccky {{/dev/sdXN}}`
|
||||
|
||||
@@ -9,7 +9,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Does not resize the underlying partition. The filesystem may have to be unmounted first, read the man page for more details.
|
||||
> More information: <https://manned.org/resize2fs>.
|
||||
|
||||
- Automatically resize a filesystem:
|
||||
- Automatically resize a filesystem to its maximum possible size:
|
||||
|
||||
`resize2fs {{/dev/sdXN}}`
|
||||
|
||||
|
||||
42
tldr/osx/orb
Normal file
42
tldr/osx/orb
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, osx]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# orb
|
||||
|
||||
> Interface for OrbStack, a fast and lightweight container and virtual machine runtime for macOS.
|
||||
> Provides Docker-compatible commands and Linux VM management.
|
||||
> More information: <https://docs.orbstack.dev/>.
|
||||
|
||||
- List all containers and VMs:
|
||||
|
||||
`orb list`
|
||||
|
||||
- Create and start a Linux virtual machine:
|
||||
|
||||
`orb create {{vm_name}}`
|
||||
|
||||
- Create a VM with a specific Linux distribution:
|
||||
|
||||
`orb create {{vm_name}} {{ubuntu|fedora|arch|debian}}`
|
||||
|
||||
- Start or stop a virtual machine:
|
||||
|
||||
`orb {{start|stop}} {{vm_name}}`
|
||||
|
||||
- Connect to a VM via SSH:
|
||||
|
||||
`orb ssh {{vm_name}}`
|
||||
|
||||
- Execute a command in a VM:
|
||||
|
||||
`orb exec {{vm_name}} {{command}}`
|
||||
|
||||
- Delete a virtual machine:
|
||||
|
||||
`orb delete {{vm_name}}`
|
||||
|
||||
- Show system status and resource usage:
|
||||
|
||||
`orb status`
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# readonly
|
||||
|
||||
> Set read-only shell variables.
|
||||
> More information: <https://manned.org/readonly.1posix>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-readonly>.
|
||||
|
||||
- Set a read-only variable:
|
||||
|
||||
|
||||
2
tldr/set
2
tldr/set
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# set
|
||||
|
||||
> Toggle shell options or set the values of positional parameters.
|
||||
> More information: <https://manned.org/set.1posix>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin>.
|
||||
|
||||
- Display the names and values of shell variables:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# shift
|
||||
|
||||
> Move positional parameters.
|
||||
> More information: <https://manned.org/shift.1posix>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-shift>.
|
||||
|
||||
- Remove the first positional parameter:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# sleep
|
||||
|
||||
> Delay for a specified amount of time.
|
||||
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html>.
|
||||
> More information: <https://manned.org/sleep>.
|
||||
|
||||
- Delay in seconds:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# source
|
||||
|
||||
> Execute commands from a file in the current shell.
|
||||
> More information: <https://manned.org/source>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-source>.
|
||||
|
||||
- Evaluate contents of a given file:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# umask
|
||||
|
||||
> Manage the read/write/execute permissions that are masked out (i.e. restricted) for newly created files by the user.
|
||||
> More information: <https://manned.org/umask>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-umask>.
|
||||
|
||||
- Display the current mask in octal notation:
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Remove aliases.
|
||||
> See also: `alias`.
|
||||
> More information: <https://manned.org/unalias>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-unalias>.
|
||||
|
||||
- Remove an alias:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# unset
|
||||
|
||||
> Remove shell variables or functions.
|
||||
> More information: <https://manned.org/unset>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-unset>.
|
||||
|
||||
- Remove the variable `foo`, or if the variable doesn't exist, remove the function `foo`:
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Wait for a process to complete before proceeding.
|
||||
> See also: `ps` to view information about running processes.
|
||||
> More information: <https://manned.org/wait>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-wait>.
|
||||
|
||||
- Wait for a process to finish given its process ID (PID) and return its exit status:
|
||||
|
||||
|
||||
@@ -19,15 +19,15 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):
|
||||
|
||||
`wget {{[-p|--page-requisites]}} {{[-k|--convert-links]}} {{[-w|--wait]}} 3 {{https://example.com/somepage.html}}`
|
||||
`wget {{[-pkw|--page-requisites --convert-links --wait]}} 3 {{https://example.com/some_page.html}}`
|
||||
|
||||
- Download all listed files within a directory and its sub-directories (does not download embedded page elements):
|
||||
|
||||
`wget {{[-m|--mirror]}} {{[-np|--no-parent]}} {{https://example.com/somepath/}}`
|
||||
`wget {{[-mnp|--mirror --no-parent]}} {{https://example.com/some_path/}}`
|
||||
|
||||
- Limit the download speed and the number of connection retries:
|
||||
|
||||
`wget --limit-rate {{300k}} {{[-t|--tries]}} {{100}} {{https://example.com/somepath/}}`
|
||||
`wget --limit-rate {{300k}} {{[-t|--tries]}} {{100}} {{https://example.com/some_path/}}`
|
||||
|
||||
- Download a file from an HTTP server using Basic Auth (also works for FTP):
|
||||
|
||||
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Download all URLs stored in a text file to a specific directory:
|
||||
|
||||
`wget {{[-P|--directory-prefix]}} {{path/to/directory}} {{[-i|--input-file]}} {{URLs.txt}}`
|
||||
`wget {{[-P|--directory-prefix]}} {{path/to/directory}} {{[-i|--input-file]}} {{path/to/URLs.txt}}`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# while
|
||||
|
||||
> Simple shell loop that repeats while the return value remains zero.
|
||||
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_09>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-while>.
|
||||
|
||||
- Read `stdin` and perform an action on every line:
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Execute a command with piped arguments coming from another command, a file, etc.
|
||||
> The input is treated as a single block of text and split into separate pieces on spaces, tabs, newlines and end-of-file.
|
||||
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html>.
|
||||
> More information: <https://www.gnu.org/software/findutils/manual/html_mono/find.html#Invoking-xargs>.
|
||||
|
||||
- Run a command using the input data as arguments:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user