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:
@@ -28,6 +28,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`coproc {{name}} { while read line; do {{command1; command2; ...}}; done }`
|
||||
|
||||
- Create a coprocess which repeatedly reads `stdin`, runs a pipeline on the input, and writes the output to `stdout`:
|
||||
|
||||
`coproc {{name}} { while read line; do echo "$line" | {{command1 | command2 | ...}} | cat /dev/fd/0; done }`
|
||||
|
||||
- Create and use a coprocess running `bc`:
|
||||
|
||||
`coproc BC { bc --mathlib; }; echo "1/3" >&"${BC[1]}"; read output <&"${BC[0]}"; echo "$output"`
|
||||
|
||||
16
tldr/cp
16
tldr/cp
@@ -18,24 +18,24 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it):
|
||||
|
||||
`cp -R {{path/to/source_directory}} {{path/to/target_directory}}`
|
||||
`cp {{[-r|--recursive]}} {{path/to/source_directory}} {{path/to/target_directory}}`
|
||||
|
||||
- Copy a directory recursively, in verbose mode (shows files as they are copied):
|
||||
|
||||
`cp -vR {{path/to/source_directory}} {{path/to/target_directory}}`
|
||||
`cp {{[-vr|--verbose --recursive]}} {{path/to/source_directory}} {{path/to/target_directory}}`
|
||||
|
||||
- Copy multiple files at once to a directory:
|
||||
|
||||
`cp -t {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`cp {{[-t|--target-directory]}} {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Copy text files to another location, in interactive mode (prompts user before overwriting):
|
||||
- Copy all files with a specific extension to another location, in interactive mode (prompts user before overwriting):
|
||||
|
||||
`cp -i {{*.txt}} {{path/to/target_directory}}`
|
||||
`cp {{[-i|--interactive]}} {{*.ext}} {{path/to/target_directory}}`
|
||||
|
||||
- Follow symbolic links before copying:
|
||||
|
||||
`cp -L {{link}} {{path/to/target_directory}}`
|
||||
`cp {{[-L|--dereference]}} {{link}} {{path/to/target_directory}}`
|
||||
|
||||
- Use the first argument as the destination directory (useful for `xargs ... | cp -t <DEST_DIR>`):
|
||||
- Use the full path of source files, creating any missing intermediate directories when copying:
|
||||
|
||||
`cp -t {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`cp --parents {{source/path/to/file}} {{path/to/target_file}}`
|
||||
|
||||
10
tldr/duc
10
tldr/duc
@@ -9,17 +9,17 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Duc maintains a database of accumulated sizes of directories of the file system, allowing queries in this database, or creating fancy graphs to show where data is.
|
||||
> More information: <http://duc.zevv.nl>.
|
||||
|
||||
- Index the /usr directory, writing to the default database location ~/.duc.db:
|
||||
- Index the `/usr` directory, writing to the default database location `~/.duc.db`:
|
||||
|
||||
`duc index {{/usr}}`
|
||||
|
||||
- List all files and directories under /usr/local, showing relative file sizes in a [g]raph:
|
||||
- List all files and directories under `/usr/local`, showing relative file sizes in a graph:
|
||||
|
||||
`duc ls -Fg {{/usr/local}}`
|
||||
`duc ls {{[-Fg|--classify --graph]}} {{/usr/local}}`
|
||||
|
||||
- List all files and directories under /usr/local using treeview recursively:
|
||||
- List all files and directories under `/usr/local` using treeview recursively:
|
||||
|
||||
`duc ls -Fg -R {{/usr/local}}`
|
||||
`duc ls {{[-Fg|--classify --graph]}} {{[-R|--recursive]}} {{/usr/local}}`
|
||||
|
||||
- Start the graphical interface to explore the file system using sunburst graphs:
|
||||
|
||||
|
||||
2
tldr/ed
2
tldr/ed
@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
|
||||
|
||||
`ed {{[-q|--quiet]}}`
|
||||
`ed {{[-q|--quiet]}} {{[-s|--script]}}`
|
||||
|
||||
- Start an interactive editor session without exit status change when command fails:
|
||||
|
||||
|
||||
@@ -31,3 +31,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Display the logs of a specific service:
|
||||
|
||||
`sudo gitlab-ctl tail {{nginx}}`
|
||||
|
||||
- Send the SIGKILL signal to specific service:
|
||||
|
||||
`sudo gitlab-ctl kill {{nginx}}`
|
||||
|
||||
- Reconfigure the application:
|
||||
|
||||
`sudo gitlab-ctl reconfigure`
|
||||
|
||||
20
tldr/last
20
tldr/last
@@ -8,26 +8,34 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> View the last logged in users.
|
||||
> More information: <https://manned.org/last>.
|
||||
|
||||
- View last logins, their duration and other information as read from `/var/log/wtmp`:
|
||||
- View last login infromation (e.g., username, terminal, boot time, kernel) of all users as read from `/var/log/wtmp`:
|
||||
|
||||
`last`
|
||||
|
||||
- List login information of a specific user:
|
||||
|
||||
`last {{username}}`
|
||||
|
||||
- Specify how many of the last logins to show:
|
||||
|
||||
`last -n {{login_count}}`
|
||||
`last {{[-n|--limit]}} {{login_count}}`
|
||||
|
||||
- Print the full date and time for entries and then display the hostname column last to prevent truncation:
|
||||
|
||||
`last -F -a`
|
||||
`last {{[-F|--fulltimes]}} {{[-a|--hostlast]}}`
|
||||
|
||||
- View all logins by a specific user and show the IP address instead of the hostname:
|
||||
|
||||
`last {{username}} -i`
|
||||
`last {{username}} {{[-i|--ip]}}`
|
||||
|
||||
- List information since a specific time and date:
|
||||
|
||||
`last {{[-s|--since]}} {{-7days}}`
|
||||
|
||||
- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
|
||||
|
||||
`last reboot`
|
||||
|
||||
- View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"):
|
||||
- Display help:
|
||||
|
||||
`last shutdown`
|
||||
`last {{[-h|--help]}}`
|
||||
|
||||
2
tldr/lex
2
tldr/lex
@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> Note: on most major OSes, this command is an alias for `flex`.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
> More information: <https://manned.org/lex>.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
|
||||
|
||||
@@ -13,10 +13,14 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`chsh`
|
||||
|
||||
- Set a specific login [s]hell for the current user:
|
||||
- List available shells:
|
||||
|
||||
`chsh --shell {{path/to/shell}}`
|
||||
`chsl {{[-l|--list-shells]}}`
|
||||
|
||||
- Set a login [s]hell for a specific user:
|
||||
- Set a specific login shell for the current user:
|
||||
|
||||
`sudo chsh --shell {{path/to/shell}} {{username}}`
|
||||
`chsh {{[-s|--shell]}} {{path/to/shell}}`
|
||||
|
||||
- Set a login shell for a specific user:
|
||||
|
||||
`sudo chsh {{[-s|--shell]}} {{path/to/shell}} {{username}}`
|
||||
|
||||
30
tldr/linux/flex
Normal file
30
tldr/linux/flex
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# flex
|
||||
|
||||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
|
||||
`flex {{analyzer.l}}`
|
||||
|
||||
- Write analyzer to `stdout`:
|
||||
|
||||
`flex {{[-t|--stdout]}} {{analyzer.l}}`
|
||||
|
||||
- Specify the output file:
|
||||
|
||||
`flex {{analyzer.l}} {{[-o|--outfile]}} {{analyzer.c}}`
|
||||
|
||||
- Generate a batch scanner instead of an interactive scanner:
|
||||
|
||||
`flex {{[-B|--batch]}} {{analyzer.l}}`
|
||||
|
||||
- Compile a C file generated by Lex:
|
||||
|
||||
`cc {{path/to/lex.yy.c}} -o {{executable}}`
|
||||
21
tldr/linux/hollywood
Normal file
21
tldr/linux/hollywood
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# hollywood
|
||||
|
||||
> Fill your console with Hollywood melodrama technobabble.
|
||||
> More information: <https://manned.org/hollywood>.
|
||||
|
||||
- Fill the console:
|
||||
|
||||
`hollywood`
|
||||
|
||||
- Exit `hollywood`:
|
||||
|
||||
`<Ctrl c><Ctrl c>`
|
||||
|
||||
- Display help:
|
||||
|
||||
`hollywood -h`
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Open a new terminal window:
|
||||
|
||||
`<Super Return>`
|
||||
`<Super Enter>`
|
||||
|
||||
- Create a new workspace:
|
||||
|
||||
|
||||
@@ -5,26 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# lex
|
||||
|
||||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
> This command is an alias of `flex`.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
- View documentation for the original command:
|
||||
|
||||
`lex {{analyzer.l}}`
|
||||
|
||||
- Write analyzer to `stdout`:
|
||||
|
||||
`lex -{{-stdout|t}} {{analyzer.l}}`
|
||||
|
||||
- Specify the output file:
|
||||
|
||||
`lex {{analyzer.l}} --outfile {{analyzer.c}}`
|
||||
|
||||
- Generate a [B]atch scanner instead of an interactive scanner:
|
||||
|
||||
`lex -B {{analyzer.l}}`
|
||||
|
||||
- Compile a C file generated by Lex:
|
||||
|
||||
`cc {{path/to/lex.yy.c}} --output {{executable}}`
|
||||
`tldr flex`
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Check or set a terminal's ability to receive messages from other users, usually from the `write` command.
|
||||
> See also `write`, `talk`.
|
||||
> More information: <https://manned.org/mesg.1>.
|
||||
> More information: <https://manned.org/mesg>.
|
||||
|
||||
- Check terminal's openness to write messages:
|
||||
|
||||
@@ -21,6 +21,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`mesg y`
|
||||
|
||||
- Enable [v]erbose mode, printing a warning if the command is not executed from a terminal:
|
||||
- Enable verbose mode, printing a warning if the command is not executed from a terminal:
|
||||
|
||||
`mesg --verbose`
|
||||
`mesg {{[-v|--verbose]}}`
|
||||
|
||||
@@ -30,4 +30,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create an empty temporary directory and print its absolute path:
|
||||
|
||||
`mktemp --directory`
|
||||
`mktemp {{[-d|--directory]}}`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# nl
|
||||
|
||||
> Number lines from a file or from `stdin`.
|
||||
> More information: <https://manned.org/nl.1p>.
|
||||
> More information: <https://manned.org/man/nl>.
|
||||
|
||||
- Number non-blank lines in a file:
|
||||
|
||||
@@ -16,26 +16,26 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`{{command}} | nl -`
|
||||
|
||||
- Number [a]ll [b]ody lines including blank lines or do [n]ot number [b]ody lines:
|
||||
- Number [a]ll body lines including blank lines or do [n]ot number body lines:
|
||||
|
||||
`nl --body-numbering {{a|n}} {{path/to/file}}`
|
||||
`nl {{[-b|--body-numbering]}} {{a|n}} {{path/to/file}}`
|
||||
|
||||
- Number only the [b]ody lines that match a basic regular expression (BRE) [p]attern:
|
||||
- Number only the body lines that match a basic regular expression (BRE) [p]attern:
|
||||
|
||||
`nl --body-numbering p'FooBar[0-9]' {{path/to/file}}`
|
||||
`nl {{[-b|--body-numbering]}} p'FooBar[0-9]' {{path/to/file}}`
|
||||
|
||||
- Use a specific [i]ncrement for line numbering:
|
||||
- Use a specific increment for line numbering:
|
||||
|
||||
`nl --line-increment {{increment}} {{path/to/file}}`
|
||||
`nl {{[-i|--line-increment]}} {{increment}} {{path/to/file}}`
|
||||
|
||||
- Specify the line numbering format to [r]ight or [l]eft justified, keeping leading [z]eros or [n]ot:
|
||||
|
||||
`nl --number-format {{rz|ln|rn}}`
|
||||
`nl {{[-n|--number-format]}} {{rz|ln|rn}}`
|
||||
|
||||
- Specify the line numbering's [w]idth (6 by default):
|
||||
- Specify the line numbering's width (6 by default):
|
||||
|
||||
`nl --number-width {{col_width}} {{path/to/file}}`
|
||||
`nl {{[-w|--number-width]}} {{col_width}} {{path/to/file}}`
|
||||
|
||||
- Use a specific string to [s]eparate the line numbers from the lines (TAB by default):
|
||||
- Use a specific string to separate the line numbers from the lines (TAB by default):
|
||||
|
||||
`nl --number-separator {{separator}} {{path/to/file}}`
|
||||
`nl {{[-s|--number-separator]}} {{separator}} {{path/to/file}}`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Navigate the snake:
|
||||
|
||||
`{{ArrowUp|ArrowDown|ArrowLeft|ArrowRight}}`
|
||||
`{{<ArrowUp>|<ArrowDown>|<ArrowLeft>|<ArrowRight>}}`
|
||||
|
||||
- Pause/unpause the game:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`yakuake`
|
||||
|
||||
- Toggle Yakuale visibility:
|
||||
- Toggle Yakuake visibility:
|
||||
|
||||
`<F12>`
|
||||
|
||||
@@ -32,6 +32,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`<Ctrl {{)|(}}>`
|
||||
|
||||
- Switch between splist:
|
||||
- Switch between splits:
|
||||
|
||||
`{{<Ctrl Tab>|<Ctrl Shift Tab>}}`
|
||||
|
||||
14
tldr/man
14
tldr/man
@@ -12,26 +12,30 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`man {{command}}`
|
||||
|
||||
- Open the man page for a command in a browser (`BROWSER` environment variable can replace `=browser_name`):
|
||||
|
||||
`man {{[-Hbrowser_name|--html=browser_name]}} {{command}}`
|
||||
|
||||
- Display the man page for a command from section 7:
|
||||
|
||||
`man {{7}} {{command}}`
|
||||
|
||||
- List all available sections for a command:
|
||||
|
||||
`man -f {{command}}`
|
||||
`man {{[-f|--whatis]}} {{command}}`
|
||||
|
||||
- Display the path searched for manpages:
|
||||
|
||||
`man --path`
|
||||
`man {{[-w|--path]}}`
|
||||
|
||||
- Display the location of a manpage rather than the manpage itself:
|
||||
|
||||
`man -w {{command}}`
|
||||
`man {{[-w|--where]}} {{command}}`
|
||||
|
||||
- Display the man page using a specific locale:
|
||||
|
||||
`man {{command}} --locale={{locale}}`
|
||||
`man {{[-L|--locale]}} {{locale}} {{command}}`
|
||||
|
||||
- Search for manpages containing a search string:
|
||||
|
||||
`man -k "{{search_string}}"`
|
||||
`man {{[-k|--apropos]}} "{{search_string}}"`
|
||||
|
||||
@@ -5,8 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mycli
|
||||
|
||||
> A command-line client for MySQL that can do auto-completion and syntax highlighting.
|
||||
> More information: <https://mycli.net>.
|
||||
> A CLI for MySQL, MariaDB, and Percona that can do auto-completion and syntax highlighting.
|
||||
> More information: <https://manned.org/mycli>.
|
||||
|
||||
- Connect to a local database on port 3306, using the current user's username:
|
||||
|
||||
@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Connect to a database (user will be prompted for a password):
|
||||
|
||||
`mycli -u {{username}} {{database_name}}`
|
||||
`mycli {{[-u|--user]}} {{username}} {{database_name}}`
|
||||
|
||||
- Connect to a database on another host:
|
||||
|
||||
`mycli -h {{database_host}} -P {{port}} -u {{username}} {{database_name}}`
|
||||
`mycli {{[-h|--host]}} {{database_host}} {{[-P|--port]}} {{port}} {{[-u|--user]}} {{username}} {{database_name}}`
|
||||
|
||||
@@ -9,4 +9,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr -p linux numfmt`
|
||||
`tldr numfmt`
|
||||
|
||||
@@ -5,10 +5,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# pngcheck
|
||||
|
||||
> Print detailed information about and verify PNG, JNG, and MNG files.
|
||||
> More information: <http://www.libpng.org/pub/png/apps/pngcheck.html>.
|
||||
> Forensics tool for validating the integrity of PNG based (PNG, JNG, MNG) image files.
|
||||
> Can also extract embedded images and text from a file.
|
||||
> More information: <https://github.com/pnggroup/pngcheck>.
|
||||
|
||||
- Print a summary for an image (width, height, and color depth):
|
||||
- Verify the integrity of an image file (width, height, and color depth):
|
||||
|
||||
`pngcheck {{path/to/image.png}}`
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# rainbowstream
|
||||
|
||||
> Terminal-based Twitter client supporting realtime tweetstream, trends, sending, search, favorites and user management.
|
||||
> Online help with `h`, `<ArrowUp>` and `<ArrowDown>` for history, `<Tab>` to auto-complete and 2-`<Tab>` for suggestion.
|
||||
> Online help with `<h>`, `<ArrowUp>` and `<ArrowDown>` for history, `<Tab>` to auto-complete and 2-`<Tab>` for suggestion.
|
||||
> More information: <https://github.com/orakaro/rainbowstream>.
|
||||
|
||||
- Open RainbowStream:
|
||||
|
||||
16
tldr/renice
16
tldr/renice
@@ -10,14 +10,18 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> See also: `nice`.
|
||||
> More information: <https://manned.org/renice>.
|
||||
|
||||
- Increase/decrease the priority of a running [p]rocess:
|
||||
- Set the absolute priority of a running process:
|
||||
|
||||
`renice -n {{3}} -p {{pid}}`
|
||||
`renice --priority {{3}} {{[-p|--pid]}} {{pid}}`
|
||||
|
||||
- Increase/decrease the priority of all processes owned by a [u]ser:
|
||||
- Increase the priority of a running process:
|
||||
|
||||
`renice -n {{-4}} -u {{uid|user}}`
|
||||
`sudo renice --relative {{-4}} {{[-p|--pid]}} {{pid}}`
|
||||
|
||||
- Increase/decrease the priority of all processes that belong to a process [g]roup:
|
||||
- Decrease the priority of all processes owned by a user:
|
||||
|
||||
`renice -n {{5}} -g {{process_group}}`
|
||||
`renice --relative {{4}} {{[-u|--user]}} {{uid|user}}`
|
||||
|
||||
- Set the priority of all processes that belong to a process group:
|
||||
|
||||
`sudo renice {{-5}} {{[-g|--pgrp]}} {{process_group}}`
|
||||
|
||||
12
tldr/rm
12
tldr/rm
@@ -15,16 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Remove specific files ignoring nonexistent ones:
|
||||
|
||||
`rm -f {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-f|--force]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files interactively prompting before each removal:
|
||||
|
||||
`rm -i {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-i|--interactive]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files printing info about each removal:
|
||||
|
||||
`rm -v {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-v|--verbose]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files and directories recursively:
|
||||
|
||||
`rm -r {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`rm {{[-r|--recursive]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Remove empty directories (this is considered the safe method):
|
||||
|
||||
`rm {{[-d|--dir]}} {{path/to/directory}}`
|
||||
|
||||
@@ -15,4 +15,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Remove specific nested directories recursively:
|
||||
|
||||
`rmdir -p {{path/to/directory1 path/to/directory2 ...}}`
|
||||
`rmdir {{[-p|--parents]}} {{path/to/directory1 path/to/directory2 ...}}`
|
||||
|
||||
20
tldr/script
20
tldr/script
@@ -5,10 +5,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# script
|
||||
|
||||
> Make a typescript file of a terminal session.
|
||||
> Record all terminal output to a typescript file.
|
||||
> More information: <https://manned.org/script>.
|
||||
|
||||
- Start recording in file named "typescript":
|
||||
- Record a new session to a file named `typescript` in the current directory:
|
||||
|
||||
`script`
|
||||
|
||||
@@ -16,14 +16,22 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`exit`
|
||||
|
||||
- Start recording in a given file:
|
||||
- Record a new session to a custom filepath:
|
||||
|
||||
`script {{logfile.log}}`
|
||||
`script {{path/to/session.out}}`
|
||||
|
||||
- Append to an existing file:
|
||||
|
||||
`script -a {{logfile.log}}`
|
||||
`script {{[-a|--append]}} {{logfile.log}}`
|
||||
|
||||
- Record timing information (data is outputted to `stderr`):
|
||||
|
||||
`script {{[-t|--timing]}} 2> {{path/to/timing_file}}`
|
||||
|
||||
- Write out data as soon as it happens:
|
||||
|
||||
`script {{[-f|--flush]}} {{path/to/file}}`
|
||||
|
||||
- Execute quietly without start and done messages:
|
||||
|
||||
`script -q {{logfile.log}}`
|
||||
`script {{[-q|--quiet]}} {{logfile.log}}`
|
||||
|
||||
22
tldr/smbmap
22
tldr/smbmap
@@ -5,25 +5,37 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# smbmap
|
||||
|
||||
> Allow users to enumerate samba share drives across an entire domain.
|
||||
> Enumerate samba share drives across an entire domain.
|
||||
> More information: <https://github.com/ShawnDEvans/smbmap>.
|
||||
|
||||
- Enumerate hosts with NULL sessions enabled and open shares:
|
||||
|
||||
`smbmap --host-file {{path/to/file}}`
|
||||
|
||||
- Display SMB shares and permissions on a host, prompting for user's password or NTLM hash:
|
||||
|
||||
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}}`
|
||||
|
||||
- Execute a shell command on a remote system:
|
||||
|
||||
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}} -x {{command}}`
|
||||
|
||||
- Enumerate hosts and check SMB file permissions:
|
||||
|
||||
`smbmap --host-file {{path/to/file}} -u {{username}} -p {{password}} -q`
|
||||
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q`
|
||||
|
||||
- Connect to an ip or hostname through smb using a username and password:
|
||||
|
||||
`smbmap -u {{username}} -p {{password}} -d {{domain}} -H {{ip_or_hostname}}`
|
||||
`smbmap {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain}} -H {{ip_or_hostname}}`
|
||||
|
||||
- Locate and download files [R]ecursively up to N levels depth, searching for filename pattern (regex), and excluding certain shares:
|
||||
|
||||
`smbmap --host-file {{path/to/file}} -u {{username}} -p {{password}} -q -R --depth {{number}} --exclude {{sharename}} -A {{filepattern}}`
|
||||
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q -R --depth {{number}} --exclude {{sharename}} -A {{filepattern}}`
|
||||
|
||||
- Upload file through smb using username and password:
|
||||
|
||||
`smbmap -u {{username}} -p {{password}} -d {{domain}} -H {{ip_or_hostname}} --upload {{path/to/file}} '{{/share_name/remote_filename}}'`
|
||||
`smbmap {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain}} -H {{ip_or_hostname}} --upload {{path/to/file}} '{{/share_name/remote_filename}}'`
|
||||
|
||||
- Display SMB shares and recursively list directories and files, searching for file content matching a regular expression:
|
||||
|
||||
`smbmap {{[-u|--username]}} {{username}} --prompt -H {{ip}} -R -F {{pattern}}`
|
||||
|
||||
12
tldr/tac
12
tldr/tac
@@ -17,14 +17,14 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`{{cat path/to/file}} | tac`
|
||||
|
||||
- Use a specific [s]eparator:
|
||||
- Use a specific separator:
|
||||
|
||||
`tac -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a specific [r]egex as a [s]eparator:
|
||||
- Use a specific regex as a separator:
|
||||
|
||||
`tac -r -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-r|--regex]}} {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a separator [b]efore each file:
|
||||
- Use a separator before each file:
|
||||
|
||||
`tac -b {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-b|--before]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
22
tldr/uname
22
tldr/uname
@@ -13,18 +13,30 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`uname`
|
||||
|
||||
- Print all available system information:
|
||||
|
||||
`uname {{[-a|--all]}}`
|
||||
|
||||
- Print system architecture and processor information:
|
||||
|
||||
`uname --machine --processor`
|
||||
`uname {{[-mp|--machine --processsor]}}`
|
||||
|
||||
- Print kernel name, kernel release and kernel version:
|
||||
|
||||
`uname --kernel-name --kernel-release --kernel-version`
|
||||
`uname {{[-srv|--kernel-name --kernel-release --kernel-version]}}`
|
||||
|
||||
- Print system hostname:
|
||||
|
||||
`uname --nodename`
|
||||
`uname {{[-n|--nodename]}}`
|
||||
|
||||
- Print all available system information:
|
||||
- Print the current operating system name:
|
||||
|
||||
`uname --all`
|
||||
`uname {{[-o|--operating-system]}}`
|
||||
|
||||
- Print the current network node host name:
|
||||
|
||||
`uname {{[-n|--nodename]}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`uname --help`
|
||||
|
||||
17
tldr/w
17
tldr/w
@@ -5,14 +5,21 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# w
|
||||
|
||||
> Show who is logged on and what they are doing.
|
||||
> Print user login, TTY, remote host, login time, idle time, current process.
|
||||
> Display who is logged in and their processes.
|
||||
> More information: <https://manned.org/w>.
|
||||
|
||||
- Show logged-in users info:
|
||||
- Display information about all users who are currently logged in:
|
||||
|
||||
`w`
|
||||
|
||||
- Show logged-in users info without a header:
|
||||
- Display information about a specific user:
|
||||
|
||||
`w -h`
|
||||
`w {{username}}`
|
||||
|
||||
- Display logged-in user information without a header:
|
||||
|
||||
`w {{[-h|--no-header]}}`
|
||||
|
||||
- Display information without including the login, JCPU and PCPU columns:
|
||||
|
||||
`w {{[-s|--short]}}`
|
||||
|
||||
24
tldr/zip
24
tldr/zip
@@ -9,30 +9,30 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> See also: `unzip`.
|
||||
> More information: <https://manned.org/zip>.
|
||||
|
||||
- Add files/directories to a specific archive ([r]ecursively):
|
||||
- Add files/directories to a specific archive:
|
||||
|
||||
`zip -r {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`zip {{[-r|--recurse-paths]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Remove files/directories from a specific archive ([d]elete):
|
||||
- Remove files/directories from a specific archive:
|
||||
|
||||
`zip -d {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`zip {{[-d|--delete]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Archive files/directories e[x]cluding specified ones:
|
||||
- Archive files/directories excluding specified ones:
|
||||
|
||||
`zip -r {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} -x {{path/to/excluded_files_or_directories}}`
|
||||
`zip {{[-r|--recurse-paths]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} {{-x|--exclude}} {{path/to/excluded_files_or_directories}}`
|
||||
|
||||
- Archive files/directories with a specific compression level (`0` - the lowest, `9` - the highest):
|
||||
|
||||
`zip -r -{{0..9}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`zip {{[-r|--recurse-paths]}} -{{0..9}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Create an [e]ncrypted archive with a specific password:
|
||||
- Create an encrypted archive with a specific password:
|
||||
|
||||
`zip -r -e {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`zip {{[-r|--recurse-paths]}} {{[-e|--encrypt]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Archive files/directories to a multi-part [s]plit Zip archive (e.g. 3 GB parts):
|
||||
- Archive files/directories to a multi-part split Zip archive (e.g. 3 GB parts):
|
||||
|
||||
`zip -r -s {{3g}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`zip {{[-r|--recurse-paths]}} {{[-s|--split-size]}} {{3g}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Print a specific archive contents:
|
||||
|
||||
`zip -sf {{path/to/compressed.zip}}`
|
||||
`zip {{[-sf|--split-size --freshen]}} {{path/to/compressed.zip}}`
|
||||
|
||||
Reference in New Issue
Block a user