mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 00:42:08 +02:00
fdisk, sops, ack, box, crictl, gprbuild, serve, shellcheck, xidel, zgep: add option placeholders and minor fixes (#16160)
* Update fdisk.md * sops * ack * box * crictl * gprbuild * serve * shellcheck * xidel * zgep
This commit is contained in:
parent
9865777403
commit
6619ffbc43
10 changed files with 42 additions and 42 deletions
|
@ -10,27 +10,27 @@
|
|||
|
||||
- Search for a case-insensitive pattern:
|
||||
|
||||
`ack --ignore-case "{{search_pattern}}"`
|
||||
`ack {{[-i|--ignore-case]}} "{{search_pattern}}"`
|
||||
|
||||
- Search for lines matching a pattern, printing [o]nly the matched text and not the rest of the line:
|
||||
|
||||
`ack -o "{{search_pattern}}"`
|
||||
`ack {{[-o|--output='$&']}} "{{search_pattern}}"`
|
||||
|
||||
- Limit search to files of a specific type:
|
||||
|
||||
`ack --type {{ruby}} "{{search_pattern}}"`
|
||||
`ack {{[-t|--type]}} {{ruby}} "{{search_pattern}}"`
|
||||
|
||||
- Do not search in files of a specific type:
|
||||
|
||||
`ack --type no{{ruby}} "{{search_pattern}}"`
|
||||
`ack {{[-t|--type]}} no{{ruby}} "{{search_pattern}}"`
|
||||
|
||||
- Count the total number of matches found:
|
||||
|
||||
`ack --count --no-filename "{{search_pattern}}"`
|
||||
`ack {{[-c|--count]}} {{[-h|--no-filename]}} "{{search_pattern}}"`
|
||||
|
||||
- Print the file names and the number of matches for each file only:
|
||||
|
||||
`ack --count --files-with-matches "{{search_pattern}}"`
|
||||
`ack {{[-c|--count]}} {{[-l|--files-with-matches]}} "{{search_pattern}}"`
|
||||
|
||||
- List all the values that can be used with `--type`:
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
`box compile`
|
||||
|
||||
- Compile a new Phar file using a specific [c]onfiguration file:
|
||||
- Compile a new Phar file using a specific configuration file:
|
||||
|
||||
`box compile -c {{path/to/config}}`
|
||||
`box compile {{[-c|--config]}} {{path/to/config}}`
|
||||
|
||||
- Display information about the PHAR PHP extension:
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
- List all containers (Running and Exited):
|
||||
|
||||
`crictl ps --all`
|
||||
`crictl ps {{[-a|--all]}}`
|
||||
|
||||
- List all images:
|
||||
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
- Open a specific shell inside a running container:
|
||||
|
||||
`crictl exec -it {{container_id}} {{sh}}`
|
||||
`crictl exec {{[-it|--interactive --tty]}} {{container_id}} {{sh}}`
|
||||
|
||||
- Pull a specific image from a registry:
|
||||
|
||||
`crictl pull {{image:tag}}`
|
||||
|
||||
- Print and [f]ollow logs of a specific container:
|
||||
- Print and follow logs of a specific container:
|
||||
|
||||
`crictl logs -f {{container_id}}`
|
||||
`crictl logs {{[-f|--follow]}} {{container_id}}`
|
||||
|
||||
- Remove one or more images:
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
- Build a specific [P]roject file:
|
||||
|
||||
`gprbuild -P{{project_name}}`
|
||||
`gprbuild -P {{project_name}}`
|
||||
|
||||
- Clean up the build workspace:
|
||||
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
|
||||
- Start an HTTP server with CORS enabled by including the `Access-Control-Allow-Origin: *` header in all responses:
|
||||
|
||||
`serve --cors`
|
||||
`serve {{[-C|--cors]}}`
|
||||
|
||||
- Start an HTTP server on the default port rewriting all not-found requests to the `index.html` file:
|
||||
|
||||
`serve --single`
|
||||
`serve {{[-s|--single]}}`
|
||||
|
||||
- Start an HTTPS server on the default port using the specified certificate:
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
- Start an HTTP server on the default port using a specific configuration file:
|
||||
|
||||
`serve --config {{path/to/serve.json}}`
|
||||
`serve {{[-c|--config]}} {{path/to/serve.json}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
|
|
|
@ -7,30 +7,30 @@
|
|||
|
||||
`shellcheck {{path/to/script.sh}}`
|
||||
|
||||
- Check a shell script interpreting it as the specified [s]hell dialect (overrides the shebang at the top of the script):
|
||||
- Check a shell script interpreting it as the specified shell dialect (overrides the shebang at the top of the script):
|
||||
|
||||
`shellcheck --shell {{sh|bash|dash|ksh}} {{path/to/script.sh}}`
|
||||
`shellcheck {{[-s|--shell]}} {{sh|bash|dash|ksh}} {{path/to/script.sh}}`
|
||||
|
||||
- Ignor[e] one or more error types:
|
||||
- Ignore one or more error types:
|
||||
|
||||
`shellcheck --exclude {{SC1009,SC1073,...}} {{path/to/script.sh}}`
|
||||
`shellcheck {{[-e|--exclude]}} {{SC1009,SC1073,...}} {{path/to/script.sh}}`
|
||||
|
||||
- Also check any sourced shell scripts:
|
||||
|
||||
`shellcheck --check-sourced {{path/to/script.sh}}`
|
||||
`shellcheck {{[-a|--check-sourced]}} {{path/to/script.sh}}`
|
||||
|
||||
- Display output in the specified [f]ormat (defaults to `tty`):
|
||||
- Display output in the specified format (defaults to `tty`):
|
||||
|
||||
`shellcheck --format {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}`
|
||||
`shellcheck {{[-f|--format]}} {{tty|checkstyle|diff|gcc|json|json1|quiet}} {{path/to/script.sh}}`
|
||||
|
||||
- Enable one or more [o]ptional checks:
|
||||
|
||||
`shellcheck --enable {{add-default-case,avoid-nullary-conditions,...}} {{path/to/script.sh}}`
|
||||
`shellcheck {{[-o|--enable]}} {{add-default-case,avoid-nullary-conditions,...}} {{path/to/script.sh}}`
|
||||
|
||||
- List all available optional checks that are disabled by default:
|
||||
|
||||
`shellcheck --list-optional`
|
||||
|
||||
- Adjust the level of [S]everity to consider (defaults to `style`):
|
||||
- Adjust the level of severity to consider (defaults to `style`):
|
||||
|
||||
`shellcheck --severity {{error|warning|info|style}} {{path/to/script.sh}}`
|
||||
`shellcheck {{[-S|--severity]}} {{error|warning|info|style}} {{path/to/script.sh}}`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# sops
|
||||
|
||||
> SOPS (Secrets OPerationS): a simple and flexible tool for managing secrets.
|
||||
> More information: <https://github.com/mozilla/sops>.
|
||||
> More information: <https://github.com/getsops/sops>.
|
||||
|
||||
- Encrypt a file:
|
||||
|
||||
|
|
|
@ -5,32 +5,32 @@
|
|||
|
||||
- Print all URLs found by a Google search:
|
||||
|
||||
`xidel {{https://www.google.com/search?q=test}} --extract "//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']"`
|
||||
`xidel {{https://www.google.com/search?q=test}} {{[-e|--extract]}} "//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']"`
|
||||
|
||||
- Print the title of all pages found by a Google search and download them:
|
||||
|
||||
`xidel {{https://www.google.com/search?q=test}} --follow "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" --extract {{//title}} --download {{'{$host}/'}}`
|
||||
`xidel {{https://www.google.com/search?q=test}} {{[-f|--follow]}} "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" {{[-e|--extract]}} {{//title}} --download {{'{$host}/'}}`
|
||||
|
||||
- Follow all links on a page and print the titles, with XPath:
|
||||
|
||||
`xidel {{https://example.org}} --follow {{//a}} --extract {{//title}}`
|
||||
`xidel {{https://example.org}} {{[-f|--follow]}} {{//a}} {{[-e|--extract]}} {{//title}}`
|
||||
|
||||
- Follow all links on a page and print the titles, with CSS selectors:
|
||||
|
||||
`xidel {{https://example.org}} --follow "{{css('a')}}" --css {{title}}`
|
||||
`xidel {{https://example.org}} {{[-f|--follow]}} "{{css('a')}}" --css {{title}}`
|
||||
|
||||
- Follow all links on a page and print the titles, with pattern matching:
|
||||
|
||||
`xidel {{https://example.org}} --follow "{{<a>{.}</a>*}}" --extract "{{<title>{.}</title>}}"`
|
||||
`xidel {{https://example.org}} {{[-f|--follow]}} "{{<a>{.}</a>*}}" {{[-e|--extract]}} "{{<title>{.}</title>}}"`
|
||||
|
||||
- Read the pattern from example.xml (which will also check if the element containing "ood" is there, and fail otherwise):
|
||||
|
||||
`xidel {{path/to/example.xml}} --extract "{{<x><foo>ood</foo><bar>{.}</bar></x>}}"`
|
||||
`xidel {{path/to/example.xml}} {{[-e|--extract]}} "{{<x><foo>ood</foo><bar>{.}</bar></x>}}"`
|
||||
|
||||
- Print all newest Stack Overflow questions with title and URL using pattern matching on their RSS feed:
|
||||
|
||||
`xidel {{http://stackoverflow.com/feeds}} --extract "{{<entry><title>{title:=.}</title><link>{uri:=@href}</link></entry>+}}"`
|
||||
`xidel {{http://stackoverflow.com/feeds}} {{[-e|--extract]}} "{{<entry><title>{title:=.}</title><link>{uri:=@href}</link></entry>+}}"`
|
||||
|
||||
- Check for unread Reddit mail, Webscraping, combining CSS, XPath, JSONiq, and automatically form evaluation:
|
||||
|
||||
`xidel {{https://reddit.com}} --follow "{{form(css('form.login-form')[1], {'user': '$your_username', 'passwd': '$your_password'})}}" --extract "{{css('#mail')/@title}}"`
|
||||
`xidel {{https://reddit.com}} {{[-f|--follow]}} "{{form(css('form.login-form')[1], {'user': '$your_username', 'passwd': '$your_password'})}}" {{[-e|--extract]}} "{{css('#mail')/@title}}"`
|
||||
|
|
|
@ -9,24 +9,24 @@
|
|||
|
||||
- Grep a pattern in a compressed file (case-insensitive):
|
||||
|
||||
`zgrep -i {{pattern}} {{path/to/compressed/file}}`
|
||||
`zgrep {{[-i|--ignore-case]}} {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Output count of lines containing matched pattern in a compressed file:
|
||||
|
||||
`zgrep -c {{pattern}} {{path/to/compressed/file}}`
|
||||
`zgrep {{[-c|--count]}} {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Display the lines which don’t have the pattern present (Invert the search function):
|
||||
|
||||
`zgrep -v {{pattern}} {{path/to/compressed/file}}`
|
||||
`zgrep {{[-v|--invert-match]}} {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Grep a compressed file for multiple patterns:
|
||||
|
||||
`zgrep -e "{{pattern_1}}" -e "{{pattern_2}}" {{path/to/compressed/file}}`
|
||||
`zgrep {{[-e|--regexp]}} "{{pattern_1}}" {{[-e|--regexp]}} "{{pattern_2}}" {{path/to/compressed/file}}`
|
||||
|
||||
- Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`):
|
||||
|
||||
`zgrep -E {{regular_expression}} {{path/to/file}}`
|
||||
`zgrep {{[-E|--extended-regexp]}} {{regular_expression}} {{path/to/file}}`
|
||||
|
||||
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
|
||||
|
||||
`zgrep -{{C|B|A}} {{3}} {{pattern}} {{path/to/compressed/file}}`
|
||||
`zgrep --{{context|before-context|after-context}} {{3}} {{pattern}} {{path/to/compressed/file}}`
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
- List partitions:
|
||||
|
||||
`sudo fdisk -l`
|
||||
`sudo fdisk {{[-l|--list]}}`
|
||||
|
||||
- Start the partition manipulator:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue