1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-03 21:15:32 +02:00

man, sudo, mount, file, curl, ps, seq, gdb, cat, upower, cal: add option placeholders (#15915)

This commit is contained in:
Managor 2025-03-11 08:07:57 +02:00 committed by GitHub
parent e7e778d467
commit 4354f86bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 56 additions and 56 deletions

View file

@ -8,30 +8,30 @@
`curl {{https://example.com}}`
- Make an HTTP GET request, fo[L]low any `3xx` redirects, and [D]ump the reply headers and contents to `stdout`:
- Make an HTTP GET request, follow any `3xx` redirects, and dump the reply headers and contents to `stdout`:
`curl --location --dump-header - {{https://example.com}}`
`curl {{[-L|--location]}} {{[-D|--dump-header]}} - {{https://example.com}}`
- Download a file, saving the [O]utput under the filename indicated by the URL:
- Download a file, saving the output under the filename indicated by the URL:
`curl --remote-name {{https://example.com/filename.zip}}`
`curl {{[-O|--remote-name]}} {{https://example.com/filename.zip}}`
- Send form-encoded [d]ata (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from `stdin`:
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from `stdin`:
`curl -X POST --data {{'name=bob'}} {{http://example.com/form}}`
`curl {{[-X|--request]}} POST {{[-d|--data]}} {{'name=bob'}} {{http://example.com/form}}`
- Send a request with an extra header, using a custom HTTP method and over a pro[x]y (such as BurpSuite), ignoring insecure self-signed certificates:
- Send a request with an extra header, using a custom HTTP method and over a proxy (such as BurpSuite), ignoring insecure self-signed certificates:
`curl -k --proxy {{http://127.0.0.1:8080}} --header {{'Authorization: Bearer token'}} --request {{GET|PUT|POST|DELETE|PATCH|...}} {{https://example.com}}`
`curl {{[-k|--insecure]}} {{[-x|--proxy]}} {{http://127.0.0.1:8080}} {{[-H|--header]}} {{'Authorization: Bearer token'}} {{[-X|--request]}} {{GET|PUT|POST|DELETE|PATCH|...}} {{https://example.com}}`
- Send data in JSON format, specifying the appropriate Content-Type [H]eader:
- Send data in JSON format, specifying the appropriate Content-Type header:
`curl --data {{'{"name":"bob"}'}} --header {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
`curl {{[-d|--data]}} {{'{"name":"bob"}'}} {{[-H|--header]}} {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
- Pass client certificate and key for a resource, skipping certificate validation:
`curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}`
`curl {{[-E|--cert]}} {{client.pem}} --key {{key.pem}} {{[-k|--insecure]}} {{https://example.com}}`
- Resolve a hostname to a custom IP address, with [v]erbose output (similar to editing the `/etc/hosts` file for custom DNS resolution):
- Resolve a hostname to a custom IP address, with verbose output (similar to editing the `/etc/hosts` file for custom DNS resolution):
`curl --verbose --resolve {{example.com}}:{{80}}:{{127.0.0.1}} {{http://example.com}}`
`curl {{[-v|--verbose]}} --resolve {{example.com}}:{{80}}:{{127.0.0.1}} {{http://example.com}}`

View file

@ -9,16 +9,16 @@
- Look inside a zipped file and determine the file type(s) inside:
`file -z {{foo.zip}}`
`file {{[-z|--uncompress]}} {{foo.zip}}`
- Allow file to work with special or device files:
`file -s {{path/to/file}}`
`file {{[-s|--special-files]}} {{path/to/file}}`
- Don't stop at first file type match; keep going until the end of the file:
`file -k {{path/to/file}}`
`file {{[-k|--keep-going]}} {{path/to/file}}`
- Determine the MIME encoding type of a file:
`file -i {{path/to/file}}`
`file {{[-i|--mime]}} {{path/to/file}}`

View file

@ -9,15 +9,15 @@
- Attach a process to gdb:
`gdb -p {{procID}}`
`gdb {{[-p|--pid]}} {{procID}}`
- Debug with a core file:
`gdb -c {{core}} {{executable}}`
`gdb {{[-c|--core]}} {{core}} {{executable}}`
- Execute given GDB commands upon start:
`gdb -ex "{{commands}}" {{executable}}`
`gdb {{[-ex|--eval-command]}} "{{commands}}" {{executable}}`
- Start `gdb` and pass arguments to the executable:
@ -25,4 +25,4 @@
- Skip debuginfod and pagination prompts and then print the backtrace:
`gdb -c {{core}} {{executable}} -iex 'set debuginfod enabled on' -iex 'set pagination off' -ex bt`
`gdb {{[-c|--core]}} {{core}} {{executable}} -iex 'set debuginfod enabled on' -iex 'set pagination off' -ex bt`

View file

@ -9,23 +9,23 @@
- Mount a device to a directory:
`mount -t {{filesystem_type}} {{path/to/device_file}} {{path/to/target_directory}}`
`mount {{[-t|--types]}} {{filesystem_type}} {{path/to/device_file}} {{path/to/target_directory}}`
- Create a specific directory if it does not exist and mount a device to it:
`mount --mkdir {{path/to/device_file}} {{path/to/target_directory}}`
`mount {{[-m|--mkdir]}} {{path/to/device_file}} {{path/to/target_directory}}`
- Mount a device to a directory for a specific user:
`mount -o uid={{user_id}},gid={{group_id}} {{path/to/device_file}} {{path/to/target_directory}}`
`mount {{[-o|--options]}} uid={{user_id}},gid={{group_id}} {{path/to/device_file}} {{path/to/target_directory}}`
- Mount a CD-ROM device (with the filetype ISO9660) to `/cdrom` (readonly):
`mount -t {{iso9660}} -o ro {{/dev/cdrom}} {{/cdrom}}`
`mount {{[-t|--types]}} {{iso9660}} {{[-o|--options]}} ro {{/dev/cdrom}} {{/cdrom}}`
- Mount all the filesystem defined in `/etc/fstab`:
`mount -a`
`mount {{[-a|--all]}}`
- Mount a specific filesystem described in `/etc/fstab` (e.g. `/dev/sda1 /my_drive ext2 defaults 0 2`):
@ -33,4 +33,4 @@
- Mount a directory to another directory:
`mount --bind {{path/to/old_dir}} {{path/to/new_dir}}`
`mount {{[-B|--bind]}} {{path/to/old_dir}} {{path/to/new_dir}}`

View file

@ -17,16 +17,16 @@
- List all processes of the current user in extra full format:
`ps --user $(id -u) -F`
`ps {{[-u|--user]}} $(id {{[-u|--user]}}) -F`
- List all processes of the current user as a tree:
`ps --user $(id -u) f`
`ps {{[-u|--user]}} $(id {{[-u|--user]}}) {{[f|--forest]}}`
- Get the parent PID of a process:
`ps -o ppid= -p {{pid}}`
`ps {{[-o|--format]}} ppid= {{[-p|--pid]}} {{pid}}`
- Sort processes by memory consumption:
`ps --sort size`
`ps {{[k|--sort]}} size`

View file

@ -13,8 +13,8 @@
- Separate the output with a space instead of a newline:
`seq -s " " 5 3 20`
`seq {{[-s|--separator]}} " " 5 3 20`
- Format output width to a minimum of 4 digits padding with zeros as necessary:
`seq -f "%04g" 5 3 20`
`seq {{[-f|--format]}} "%04g" 5 3 20`

View file

@ -9,11 +9,11 @@
- Edit a file as the superuser with your default editor:
`sudo --edit {{/etc/fstab}}`
`sudo {{[-e|--edit]}} {{/etc/fstab}}`
- Run a command as another user and/or group:
`sudo --user={{user}} --group={{group}} {{id -a}}`
`sudo {{[-u|--user]}} {{user}} {{[-g|--group]}} {{group}} {{id -a}}`
- Repeat the last command prefixed with `sudo` (only in Bash, Zsh, etc.):
@ -21,16 +21,16 @@
- Launch the default shell with superuser privileges and run login-specific files (`.profile`, `.bash_profile`, etc.):
`sudo --login`
`sudo {{[-i|--login]}}`
- Launch the default shell with superuser privileges without changing the environment:
`sudo --shell`
`sudo {{[-s|--shell]}}`
- Launch the default shell as the specified user, loading the user's environment and reading login-specific files (`.profile`, `.bash_profile`, etc.):
`sudo --login --user={{user}}`
`sudo {{[-i|--login]}} {{[-u|--user]}} {{user}}`
- List the allowed (and forbidden) commands for the invoking user:
`sudo --list`
`sudo {{[-l|--list]}}`

View file

@ -7,21 +7,21 @@
`cal`
- Display [3] months spanning the date:
- Display 3 months spanning the date:
`cal -3`
`cal {{[-3|--three]}}`
- Display the whole calendar for the current [y]ear:
`cal --year`
`cal {{[-y|--year]}}`
- Display the next twelve months:
`cal --twelve`
`cal {{[-Y|--twelve]}}`
- Use Monday as the first day of the week:
`cal --monday`
`cal {{[-m|--monday]}}`
- Display a calendar for a specific year (4 digits):

View file

@ -21,8 +21,8 @@
- [n]umber all output lines:
`cat -n {{path/to/file}}`
`cat {{[-n|--number]}} {{path/to/file}}`
- Display non-printable and whitespace characters (with `M-` prefix if non-ASCII):
`cat -v -t -e {{path/to/file}}`
`cat {{[-vte|--show-nonprinting -t -e]}} {{path/to/file}}`

View file

@ -9,7 +9,7 @@
- Open the man page for a command in a browser (`BROWSER` environment variable can replace `=browser_name`):
`man --html{{=browser_name}} {{command}}`
`man {{[-H|--html=]}}{{browser_name}} {{command}}`
- Display the man page for a command from section 7:
@ -17,20 +17,20 @@
- List all available sections for a command:
`man --whatis {{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 --where {{command}}`
`man {{[-w|--where]}} {{command}}`
- Display the man page using a specific locale:
`man --locale {{locale}} {{command}}`
`man {{[-L|--locale]}} {{locale}} {{command}}`
- Search for manpages containing a search string:
`man --apropos "{{search_string}}"`
`man {{[-k|--apropos]}} "{{search_string}}"`

View file

@ -5,15 +5,15 @@
- Display power and battery information:
`upower --dump`
`upower {{[-d|--dump]}}`
- List all power devices:
`upower --enumerate`
`upower {{[-e|--enumerate]}}`
- Watch for and print power status changes:
`upower --monitor`
`upower {{[-m|--monitor]}}`
- Watch for and print detailed power status changes:
@ -21,4 +21,4 @@
- Display version:
`upower --version`
`upower {{[-v|--version]}}`