diff --git a/pages/common/curl.md b/pages/common/curl.md index aeca58fc8c..1aa8bb1ee8 100644 --- a/pages/common/curl.md +++ b/pages/common/curl.md @@ -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}}` diff --git a/pages/common/file.md b/pages/common/file.md index f2de979abf..fce9b94ade 100644 --- a/pages/common/file.md +++ b/pages/common/file.md @@ -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}}` diff --git a/pages/common/gdb.md b/pages/common/gdb.md index 13ca488f96..9a1d925ef3 100644 --- a/pages/common/gdb.md +++ b/pages/common/gdb.md @@ -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` diff --git a/pages/common/mount.md b/pages/common/mount.md index 54133d6501..795281da1e 100644 --- a/pages/common/mount.md +++ b/pages/common/mount.md @@ -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}}` diff --git a/pages/common/ps.md b/pages/common/ps.md index 33919e8abc..ef7ee0c748 100644 --- a/pages/common/ps.md +++ b/pages/common/ps.md @@ -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` diff --git a/pages/common/seq.md b/pages/common/seq.md index 46c0c539d0..6d09640275 100644 --- a/pages/common/seq.md +++ b/pages/common/seq.md @@ -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` diff --git a/pages/common/sudo.md b/pages/common/sudo.md index 3037b9ce5c..17af75a747 100644 --- a/pages/common/sudo.md +++ b/pages/common/sudo.md @@ -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]}}` diff --git a/pages/linux/cal.md b/pages/linux/cal.md index 1bb9a8850f..8e8c097363 100644 --- a/pages/linux/cal.md +++ b/pages/linux/cal.md @@ -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): diff --git a/pages/linux/cat.md b/pages/linux/cat.md index 195075887c..5ddb6af476 100644 --- a/pages/linux/cat.md +++ b/pages/linux/cat.md @@ -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}}` diff --git a/pages/linux/man.md b/pages/linux/man.md index 74e7d801f5..e285e78bba 100644 --- a/pages/linux/man.md +++ b/pages/linux/man.md @@ -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}}"` diff --git a/pages/linux/upower.md b/pages/linux/upower.md index 92983e89c1..5e96f6db98 100644 --- a/pages/linux/upower.md +++ b/pages/linux/upower.md @@ -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]}}`