Update cheatsheets

This commit is contained in:
ivuorinen
2024-06-27 00:14:26 +00:00
parent e258e7ab99
commit 3b52a5cc92
7 changed files with 13 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`{{command}} | nl -`
- Number [a]ll [b]ody lines including blank lines or do not [n]umber [b]ody lines:
- Number [a]ll [b]ody lines including blank lines or do [n]ot number [b]ody lines:
`nl --body-numbering {{a|n}} {{path/to/file}}`
@@ -32,10 +32,10 @@ source: https://github.com/tldr-pages/tldr.git
`nl --number-format {{rz|ln|rn}}`
- Specify the line numbering's width (6 by default):
- Specify the line numbering's [w]idth (6 by default):
`nl --number-width {{col_width}} {{path/to/file}}`
- Use a specific string to separate the line numbers from the lines (TAB by default):
- Use a specific string to [s]eparate the line numbers from the lines (TAB by default):
`nl --number-separator {{separator}} {{path/to/file}}`

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`{{command}} | nl -`
- Number [a]ll [b]ody lines including blank lines or do [n]ot number body lines:
- Number [a]ll [b]ody lines including blank lines or do [n]ot number [b]ody lines:
`nl -b {{a|n}} {{path/to/file}}`

View File

@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
- Convert 1.5K (SI Units) to 1500:
`numfmt --from={{si}} {{1.5K}}`
`numfmt --from=si 1.5K`
- Convert 5th field (1-indexed) to IEC Units without converting header:
`ls -l | numfmt --header={{1}} --field={{5}} --to={{iec}}`
`ls -l | numfmt --header=1 --field=5 --to=iec`
- Convert to IEC units, pad with 5 characters, left aligned:
`du -s * | numfmt --to={{iec}} --format="{{%-5f}}"`
`du -s * | numfmt --to=iec --format="%-5f"`

View File

@@ -31,4 +31,4 @@ source: https://github.com/tldr-pages/tldr.git
- Read only 100 bytes of a file starting from the 500th byte:
`od --read-bytes {{100}} --skip-bytes={{500}} -v {{path/to/file}}`
`od --read-bytes 100 --skip-bytes=500 -v {{path/to/file}}`

View File

@@ -18,13 +18,13 @@ source: https://github.com/tldr-pages/tldr.git
- Merge two files side by side, each in its column, using TAB as delimiter:
`paste {{file1}} {{file2}}`
`paste {{path/to/file1}} {{path/to/file2}}`
- Merge two files side by side, each in its column, using the specified delimiter:
`paste -d {{delimiter}} {{file1}} {{file2}}`
`paste -d {{delimiter}} {{path/to/file1}} {{path/to/file2}}`
- Merge two files, with lines added alternatively:
`paste -d '
' {{file1}} {{file2}}`
' {{path/to/file1}} {{path/to/file2}}`

View File

@@ -26,7 +26,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print, beginning at page 2 up to page 5, with a given page length (including header and footer):
`pr +{{2}}:{{5}} -l {{page_length}} {{path/to/file1 path/to/file2 ...}}`
`pr +2:5 -l {{page_length}} {{path/to/file1 path/to/file2 ...}}`
- Print with an offset for each line and a truncating custom page width:

View File

@@ -19,7 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`
`find . -name '*.backup' -print0 | xargs -0 rm -v`
- Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line: