Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-23 00:20:07 +00:00
parent a49466c200
commit cd59a77dc8
31 changed files with 239 additions and 130 deletions

View File

@@ -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
View 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
View 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`

View File

@@ -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:

View File

@@ -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`

View File

@@ -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]}}`

View File

@@ -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]}}`

View File

@@ -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}}`

View 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:

View File

@@ -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>}}`