diff --git a/pages/common/arp-scan.md b/pages/common/arp-scan.md index 25cbcbba46..5a22e7709f 100644 --- a/pages/common/arp-scan.md +++ b/pages/common/arp-scan.md @@ -5,7 +5,7 @@ - Scan the current local network: -`arp-scan --localnet` +`arp-scan {{[-l|--localnet]}}` - Scan an IP network with a custom bitmask: diff --git a/pages/common/chgrp.md b/pages/common/chgrp.md index a8e6a46648..1af25cc593 100644 --- a/pages/common/chgrp.md +++ b/pages/common/chgrp.md @@ -9,11 +9,11 @@ - Recursively change the owner group of a directory and its contents: -`chgrp -R {{group}} {{path/to/directory}}` +`chgrp {{[-R|--recursive]}} {{group}} {{path/to/directory}}` - Change the owner group of a symbolic link: -`chgrp -h {{group}} {{path/to/symlink}}` +`chgrp {{[-h|--no-dereference]}} {{group}} {{path/to/symlink}}` - Change the owner group of a file/directory to match a reference file: diff --git a/pages/common/chmod.md b/pages/common/chmod.md index 7f7fe308ff..ef775d7772 100644 --- a/pages/common/chmod.md +++ b/pages/common/chmod.md @@ -29,8 +29,8 @@ - Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite: -`chmod -R g+w,o+w {{path/to/directory}}` +`chmod {{[-R|--recursive]}} g+w,o+w {{path/to/directory}}` - Recursively give [a]ll users [r]ead permissions to files and e[X]ecute permissions to sub-directories within a directory: -`chmod -R a+rX {{path/to/directory}}` +`chmod {{[-R|--recursive]}} a+rX {{path/to/directory}}` diff --git a/pages/common/chown.md b/pages/common/chown.md index adfc897d05..351cc67c72 100644 --- a/pages/common/chown.md +++ b/pages/common/chown.md @@ -17,11 +17,11 @@ - Recursively change the owner of a directory and its contents: -`chown -R {{user}} {{path/to/directory}}` +`chown {{[-R|--recursive]}} {{user}} {{path/to/directory}}` - Change the owner of a symbolic link: -`chown -h {{user}} {{path/to/symlink}}` +`chown {{[-h|--no-dereference]}} {{user}} {{path/to/symlink}}` - Change the owner of a file/directory to match a reference file: diff --git a/pages/common/cmp.md b/pages/common/cmp.md index cc42117f16..1f21216e8f 100644 --- a/pages/common/cmp.md +++ b/pages/common/cmp.md @@ -9,12 +9,12 @@ - Output info of the first difference: char, line number, bytes, and values: -`cmp --print-bytes {{path/to/file1}} {{path/to/file2}}` +`cmp {{[-b|--print-bytes]}} {{path/to/file1}} {{path/to/file2}}` - Output the byte numbers and values of every difference: -`cmp --verbose {{path/to/file1}} {{path/to/file2}}` +`cmp {{[-v|--verbose]}} {{path/to/file1}} {{path/to/file2}}` - Compare files but output nothing, yield only the exit status: -`cmp --quiet {{path/to/file1}} {{path/to/file2}}` +`cmp {{[-s|--quiet]}} {{path/to/file1}} {{path/to/file2}}` diff --git a/pages/common/column.md b/pages/common/column.md index 110c6d9e45..8b6c3a9ea2 100644 --- a/pages/common/column.md +++ b/pages/common/column.md @@ -6,16 +6,16 @@ - Format the output of a command for a 30 characters wide display: -`printf "header1 header2\nbar foo\n" | column --output-width {{30}}` +`printf "header1 header2\nbar foo\n" | column {{[-c|--output-width]}} {{30}}` - Split columns automatically and auto-align them in a tabular format: -`printf "header1 header2\nbar foo\n" | column --table` +`printf "header1 header2\nbar foo\n" | column {{[-t|--table]}}` - Specify the column delimiter character for the `--table` option (e.g. "," for CSV) (defaults to whitespace): -`printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}` +`printf "header1,header2\nbar,foo\n" | column {{[-t|--table]}} {{[-s|--separator]}} {{,}}` - Fill rows before filling columns: -`printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows` +`printf "header1\nbar\nfoobar\n" | column {{[-c|{{[-c|--output-width]}}]}} {{30}} {{[-x|--fillrows]}}` diff --git a/pages/common/du.md b/pages/common/du.md index c3d8abdc9b..b438c9df27 100644 --- a/pages/common/du.md +++ b/pages/common/du.md @@ -9,24 +9,24 @@ - List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size): -`du -h {{path/to/directory}}` +`du {{[-h|--human-readable]}} {{path/to/directory}}` - Show the size of a single directory, in human-readable units: -`du -sh {{path/to/directory}}` +`du {{[-sh|--summarize --human-readable]}} {{path/to/directory}}` - List the human-readable sizes of a directory and of all the files and directories within it: -`du -ah {{path/to/directory}}` +`du {{[-ah|--all --human-readable]}} {{path/to/directory}}` - List the human-readable sizes of a directory and any subdirectories, up to N levels deep: -`du -h --max-depth=N {{path/to/directory}}` +`du {{[-h|--human-readable]}} {{[-d|--max-depth]}} N {{path/to/directory}}` - List the human-readable size of all `.jpg` files in current directory, and show a cumulative total at the end: -`du -ch {{./*.jpg}}` +`du {{[-ch|--total --human-readable]}} {{./*.jpg}}` -- List all files and directories (including hidden ones) above a certain [t]hreshold size (useful for investigating what is actually taking up the space): +- List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space): -`du --all --human-readable --threshold {{1G|1024M|1048576K}} .[^.]* *` +`du {{[-ah|--all --human-readable]}} {{[-t|--threshold]}} {{1G|1024M|1048576K}} .[^.]* *` diff --git a/pages/common/ed.md b/pages/common/ed.md index dc54074e8d..2ec44a143d 100644 --- a/pages/common/ed.md +++ b/pages/common/ed.md @@ -10,19 +10,19 @@ - Start an interactive editor session with an empty document and a specific prompt: -`ed --prompt='> '` +`ed {{[-p|--prompt]}} '{{> }}'` - Start an interactive editor session with user-friendly errors: -`ed --verbose` +`ed {{[-v|--verbose]}}` - Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt: -`ed --quiet` +`ed {{[-q|--quiet]}}` - Start an interactive editor session without exit status change when command fails: -`ed --loose-exit-status` +`ed {{[-l|--loose-exit-status]}}` - Edit a specific file (this shows the byte count of the loaded file): @@ -30,4 +30,8 @@ - Replace a string with a specific replacement for all lines: -`,s/{{regular_expression}}/{{replacement}}/g` +`,s/{{regular_expression}}/{{replacement}}/g` + +- Exit ed: + +`q` diff --git a/pages/common/emacs.md b/pages/common/emacs.md index b341ce9833..49c4cc57f4 100644 --- a/pages/common/emacs.md +++ b/pages/common/emacs.md @@ -18,7 +18,7 @@ - Start Emacs in console mode (without an X window): -`emacs --no-window-system` +`emacs {{[-nw|--no-window-system]}}` - Start an Emacs server in the background (accessible via `emacsclient`): diff --git a/pages/common/ffmpeg.md b/pages/common/ffmpeg.md index 9209911c82..373323bd0c 100644 --- a/pages/common/ffmpeg.md +++ b/pages/common/ffmpeg.md @@ -13,7 +13,7 @@ - Save a video as GIF, scaling the height to 1000px and setting framerate to 15: -`ffmpeg -i {{path/to/video.mp4}} -vf 'scale=-1:{{1000}}' -r {{15}} {{path/to/output.gif}}` +`ffmpeg -i {{path/to/video.mp4}} {{[-vf|-filter:v]}} 'scale=-1:{{1000}}' -r {{15}} {{path/to/output.gif}}` - Combine numbered images (`frame_1.jpg`, `frame_2.jpg`, etc) into a video or GIF: @@ -21,16 +21,16 @@ - Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end): -`ffmpeg -i {{path/to/input_video.mp4}} -ss {{mm:ss}} -to {{mm2:ss2}} -codec copy {{path/to/output_video.mp4}}` +`ffmpeg -i {{path/to/input_video.mp4}} -ss {{mm:ss}} -to {{mm2:ss2}} {{[-c|-codec]}} copy {{path/to/output_video.mp4}}` - Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23: -`ffmpeg -i {{path/to/input_video}}.avi -codec:a aac -b:a 128k -codec:v libx264 -crf 23 {{path/to/output_video}}.mp4` +`ffmpeg -i {{path/to/input_video}}.avi {{[-c|-codec]}}:a aac -b:a 128k {{[-c|-codec]}}:v libx264 -crf 23 {{path/to/output_video}}.mp4` - Remux MKV video to MP4 without re-encoding audio or video streams: -`ffmpeg -i {{path/to/input_video}}.mkv -codec copy {{path/to/output_video}}.mp4` +`ffmpeg -i {{path/to/input_video}}.mkv {{[-c|-codec]}} copy {{path/to/output_video}}.mp4` - Convert MP4 video to VP9 codec. For the best quality, use a CRF value (recommended range 15-35) and -b:v MUST be 0: -`ffmpeg -i {{path/to/input_video}}.mp4 -codec:v libvpx-vp9 -crf {{30}} -b:v 0 -codec:a libopus -vbr on -threads {{number_of_threads}} {{path/to/output_video}}.webm` +`ffmpeg -i {{path/to/input_video}}.mp4 {{[-c|-codec]}}:v libvpx-vp9 -crf {{30}} -b:v 0 {{[-c|-codec]}}:a libopus -vbr on -threads {{number_of_threads}} {{path/to/output_video}}.webm` diff --git a/pages/common/ln.md b/pages/common/ln.md index b5073a097d..ae223b7efd 100644 --- a/pages/common/ln.md +++ b/pages/common/ln.md @@ -5,11 +5,11 @@ - Create a symbolic link to a file or directory: -`ln -s {{/path/to/file_or_directory}} {{path/to/symlink}}` +`ln {{[-s|--symbolic]}} {{/path/to/file_or_directory}} {{path/to/symlink}}` - Overwrite an existing symbolic link to point to a different file: -`ln -sf {{/path/to/new_file}} {{path/to/symlink}}` +`ln {{[-sf|--symbolic --force]}} {{/path/to/new_file}} {{path/to/symlink}}` - Create a hard link to a file: diff --git a/pages/common/ls.md b/pages/common/ls.md index 9e90e71055..22647e6a95 100644 --- a/pages/common/ls.md +++ b/pages/common/ls.md @@ -7,30 +7,30 @@ `ls -1` -- List [a]ll files, including hidden files: +- List all files, including hidden files: -`ls -a` +`ls {{[-a|--all]}}` - List files with a trailing symbol to indicate file type (directory/, symbolic_link@, executable*, ...): -`ls -F` +`ls {{[-F|--classify]}}` -- List [a]ll files in [l]ong format (permissions, ownership, size, and modification date): +- List all files in [l]ong format (permissions, ownership, size, and modification date): -`ls -la` +`ls {{[-la|--all -l]}}` -- List files in [l]ong format with size displayed using [h]uman-readable units (KiB, MiB, GiB): +- List files in [l]ong format with size displayed using human-readable units (KiB, MiB, GiB): -`ls -lh` +`ls {{[-lh|-l --human-readable]}}` -- List files in [l]ong format, sorted by [S]ize (descending) [R]ecursively: +- List files in [l]ong format, sorted by [S]ize (descending) recursively: -`ls -lSR` +`ls {{-lSR|-lS --recursive}}` -- List files in [l]ong format, sorted by [t]ime the file was modified and in [r]everse order (oldest first): +- List files in [l]ong format, sorted by [t]ime the file was modified and in reverse order (oldest first): -`ls -ltr` +`ls {{[-ltr|-lt --reverse]}}` -- Only list [d]irectories: +- Only list directories: -`ls -d */` +`ls {{[-d|--directory]}} */` diff --git a/pages/common/nano.md b/pages/common/nano.md index 85e2c18a3a..c4a1f789a6 100644 --- a/pages/common/nano.md +++ b/pages/common/nano.md @@ -9,7 +9,7 @@ - Start the editor without using configuration files: -`nano --ignorercfiles` +`nano {{[-I|--ignorercfiles]}}` - Open specific files, moving to the next file when closing the previous one: @@ -21,12 +21,16 @@ - Open a file and enable soft wrapping: -`nano --softwrap {{path/to/file}}` +`nano {{[-S|--softwrap]}} {{path/to/file}}` - Open a file and indent new lines to the previous line's indentation: -`nano --autoindent {{path/to/file}}` +`nano {{[-i|--autoindent]}} {{path/to/file}}` - Open a file and create a backup file (`path/to/file~`) on save: -`nano --backup {{path/to/file}}` +`nano {{[-B|--backup]}} {{path/to/file}}` + +- Exit nano: + +`` diff --git a/pages/common/pgrep.md b/pages/common/pgrep.md index f1ceca2c86..02349825d4 100644 --- a/pages/common/pgrep.md +++ b/pages/common/pgrep.md @@ -9,8 +9,8 @@ - Search for processes including their command-line options: -`pgrep --full "{{process_name}} {{parameter}}"` +`pgrep {{[-f|--full]}} "{{process_name}} {{parameter}}"` - Search for processes run by a specific user: -`pgrep --euid root {{process_name}}` +`pgrep {{[-u|--euid]}} root {{process_name}}` diff --git a/pages/common/pkill.md b/pages/common/pkill.md index bd230985bd..a85d37a51c 100644 --- a/pages/common/pkill.md +++ b/pages/common/pkill.md @@ -10,7 +10,7 @@ - Kill all processes which match their full command instead of just the process name: -`pkill -f "{{command_name}}"` +`pkill {{[-f|--full]}} "{{command_name}}"` - Force kill matching processes (can't be blocked): @@ -22,4 +22,4 @@ - Kill the main `firefox` process to close the browser: -`pkill --oldest "{{firefox}}"` +`pkill {{[-o|--oldest]}} "{{firefox}}"` diff --git a/pages/common/pwd.md b/pages/common/pwd.md index ef35d77b6a..ecde0021b2 100644 --- a/pages/common/pwd.md +++ b/pages/common/pwd.md @@ -9,4 +9,4 @@ - Print the current directory, and resolve all symlinks (i.e. show the "physical" path): -`pwd -P` +`pwd {{[-P|--physical]}}` diff --git a/pages/common/sort.md b/pages/common/sort.md index 7ba9172479..e55a876324 100644 --- a/pages/common/sort.md +++ b/pages/common/sort.md @@ -9,28 +9,28 @@ - Sort a file in descending order: -`sort --reverse {{path/to/file}}` +`sort {{[-r|--reverse]}} {{path/to/file}}` - Sort a file in case-insensitive way: -`sort --ignore-case {{path/to/file}}` +`sort {{-f|--ignore-case}} {{path/to/file}}` - Sort a file using numeric rather than alphabetic order: -`sort --numeric-sort {{path/to/file}}` +`sort {{[-n|--numeric-sort]}} {{path/to/file}}` - Sort `/etc/passwd` by the 3rd field of each line numerically, using ":" as a field separator: -`sort --field-separator={{:}} --key={{3n}} {{/etc/passwd}}` +`sort {{[-t|--field-separator]}} {{:}} {{[-k|--key]}} {{3n}} {{/etc/passwd}}` - As above, but when items in the 3rd field are equal, sort by the 4th field by numbers with exponents: -`sort -t {{:}} -k {{3,3n}} -k {{4,4g}} {{/etc/passwd}}` +`sort {{[-t|--field-separator]}} {{:}} {{[-k|--key]}} {{3,3n}} {{[-k|--key]}} {{4,4g}} {{/etc/passwd}}` - Sort a file preserving only unique lines: -`sort --unique {{path/to/file}}` +`sort {{[-u|--unique]}} {{path/to/file}}` - Sort a file, printing the output to the specified output file (can be used to sort a file in-place): -`sort --output={{path/to/file}} {{path/to/file}}` +`sort {{[-o|--output]}} {{path/to/file}} {{path/to/file}}` diff --git a/pages/common/tail.md b/pages/common/tail.md index ed26eeae90..b218c511c4 100644 --- a/pages/common/tail.md +++ b/pages/common/tail.md @@ -6,24 +6,24 @@ - Show last 'count' lines in file: -`tail --lines {{count}} {{path/to/file}}` +`tail {{[-n|--lines]}} {{count}} {{path/to/file}}` - Print a file from a specific line number: -`tail --lines +{{count}} {{path/to/file}}` +`tail {{[-n|--lines]}} +{{count}} {{path/to/file}}` - Print a specific count of bytes from the end of a given file: -`tail --bytes {{count}} {{path/to/file}}` +`tail {{[-c|--bytes]}} {{count}} {{path/to/file}}` - Print the last lines of a given file and keep reading it until ``: -`tail --follow {{path/to/file}}` +`tail {{[-f|--follow]}} {{path/to/file}}` - Keep reading file until ``, even if the file is inaccessible: -`tail --retry --follow {{path/to/file}}` +`tail --retry {{[-f|--follow]}} {{path/to/file}}` - Show last 'num' lines in 'file' and refresh every 'n' seconds: -`tail --lines {{count}} --sleep-interval {{seconds}} --follow {{path/to/file}}` +`tail {{[-n|--lines]}} {{count}} {{[-s|--sleep-interval]}} {{seconds}} {{[-f|--follow]}} {{path/to/file}}` diff --git a/pages/common/tee.md b/pages/common/tee.md index 6d2e4c2a8c..684854758d 100644 --- a/pages/common/tee.md +++ b/pages/common/tee.md @@ -9,7 +9,7 @@ - Append to the given files, do not overwrite: -`echo "example" | tee -a {{path/to/file}}` +`echo "example" | tee {{[-a|--append]}} {{path/to/file}}` - Print `stdin` to the terminal, and also pipe it into another program for further processing: diff --git a/pages/common/touch.md b/pages/common/touch.md index 7a9749cd9c..929ebe02dc 100644 --- a/pages/common/touch.md +++ b/pages/common/touch.md @@ -7,14 +7,14 @@ `touch {{path/to/file1 path/to/file2 ...}}` -- Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist: +- Set the file [a]ccess or [m]odification times to the current one and don't create file if it doesn't exist: -`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}` +`touch {{[-c|--no-create]}} -{{a|m}} {{path/to/file1 path/to/file2 ...}}` -- Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist: +- Set the file [t]ime to a specific value and don't create file if it doesn't exist: -`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}` +`touch {{[-c|--no-create]}} -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}` -- Set the files' timestamp to the [r]eference file's timestamp, and do not [c]reate the file if it does not exist: +- Set the files' timestamp to the reference file's timestamp, and do not create the file if it does not exist: -`touch -c -r {{path/to/reference_file}} {{path/to/file1 path/to/file2 ...}}` +`touch {{[-c|--no-create]}} {{[-r|--reference]}} {{path/to/reference_file}} {{path/to/file1 path/to/file2 ...}}` diff --git a/pages/common/uptime.md b/pages/common/uptime.md index 31b126f3d4..377c4d3e7d 100644 --- a/pages/common/uptime.md +++ b/pages/common/uptime.md @@ -9,12 +9,12 @@ - Show only the amount of time the system has been booted for: -`uptime --pretty` +`uptime {{[-p|--pretty]}}` - Print the date and time the system booted up at: -`uptime --since` +`uptime {{[-s|--since]}}` - Display version: -`uptime --version` +`uptime {{[-V|--version]}}` diff --git a/pages/common/watch.md b/pages/common/watch.md index 803af70cc5..13ad4389e0 100644 --- a/pages/common/watch.md +++ b/pages/common/watch.md @@ -9,11 +9,11 @@ - Re-run a command every 60 seconds: -`watch --interval {{60}} {{command}}` +`watch {{[-n|--interval]}} {{60}} {{command}}` - Monitor disk space, highlighting differences as they appear: -`watch --differences {{df}}` +`watch {{[-d|--differences]}} {{df}}` - Repeatedly run a pipeline and show the result: @@ -21,8 +21,8 @@ - Exit `watch` if the visible output changes: -`watch --chgexit {{lsblk}}` +`watch {{[-g|--chgexit]}} {{lsblk}}` - Interpret terminal control characters: -`watch --color {{ls --color=always}}` +`watch {{[-c|--color]}} {{ls --color=always}}` diff --git a/pages/common/wget.md b/pages/common/wget.md index 711a91b11c..e41a558fdc 100644 --- a/pages/common/wget.md +++ b/pages/common/wget.md @@ -10,28 +10,28 @@ - Download the contents of a URL to a file (named "bar" in this case): -`wget --output-document {{bar}} {{https://example.com/foo}}` +`wget {{[-O|--output-document]}} {{bar}} {{https://example.com/foo}}` - Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.): -`wget --page-requisites --convert-links --wait=3 {{https://example.com/somepage.html}}` +`wget {{[-p|--page-requisites]}} {{[-k|--convert-links]}} {{[-w|--wait]}} 3 {{https://example.com/somepage.html}}` - Download all listed files within a directory and its sub-directories (does not download embedded page elements): -`wget --mirror --no-parent {{https://example.com/somepath/}}` +`wget {{[-m|--mirror]}} {{[-np|--no-parent]}} {{https://example.com/somepath/}}` - Limit the download speed and the number of connection retries: -`wget --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}` +`wget --limit-rate {{300k}} {{[-t|--tries]}} {{100}} {{https://example.com/somepath/}}` - Download a file from an HTTP server using Basic Auth (also works for FTP): -`wget --user={{username}} --password={{password}} {{https://example.com}}` +`wget --user {{username}} --password {{password}} {{https://example.com}}` - Continue an incomplete download: -`wget --continue {{https://example.com}}` +`wget {{[-c|--continue]}} {{https://example.com}}` - Download all URLs stored in a text file to a specific directory: -`wget --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}` +`wget {{[-P|--directory-prefix]}} {{path/to/directory}} {{[-i|--input-file]}} {{URLs.txt}}` diff --git a/pages/common/who.md b/pages/common/who.md index bd022e9806..ec7e24943a 100644 --- a/pages/common/who.md +++ b/pages/common/who.md @@ -10,8 +10,8 @@ - Display all available information: -`who -a` +`who {{[-a|--all]}}` - Display all available information with table headers: -`who -a -H` +`who {{[-aH|--all --heading]}}` diff --git a/pages/linux/cp.md b/pages/linux/cp.md index e53cd7154f..c2c8f0f832 100644 --- a/pages/linux/cp.md +++ b/pages/linux/cp.md @@ -13,23 +13,23 @@ - Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it): -`cp -r {{path/to/source_directory}} {{path/to/target_directory}}` +`cp {{[-r|--recursive]}} {{path/to/source_directory}} {{path/to/target_directory}}` - Copy a directory recursively, in verbose mode (shows files as they are copied): -`cp -vr {{path/to/source_directory}} {{path/to/target_directory}}` +`cp {{[-vr|--verbose --recursive]}} {{path/to/source_directory}} {{path/to/target_directory}}` - Copy multiple files at once to a directory: -`cp -t {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}` +`cp {{[-t|--target-directory]}} {{path/to/destination_directory}} {{path/to/file1 path/to/file2 ...}}` - Copy all files with a specific extension to another location, in interactive mode (prompts user before overwriting): -`cp -i {{*.ext}} {{path/to/target_directory}}` +`cp {{[-i|--interactive]}} {{*.ext}} {{path/to/target_directory}}` - Follow symbolic links before copying: -`cp -L {{link}} {{path/to/target_directory}}` +`cp {{[-L|--dereference]}} {{link}} {{path/to/target_directory}}` - Use the full path of source files, creating any missing intermediate directories when copying: diff --git a/pages/linux/dir.md b/pages/linux/dir.md index 4879ae093a..18c6d1aa46 100644 --- a/pages/linux/dir.md +++ b/pages/linux/dir.md @@ -6,7 +6,7 @@ - List all files, including hidden files: -`dir --all` +`dir {{[-a|--all]}}` - List files including their author (`-l` is required): @@ -14,11 +14,11 @@ - List files excluding those that match a specified blob pattern: -`dir --hide={{pattern}}` +`dir --hide {{pattern}}` - List subdirectories recursively: -`dir --recursive` +`dir {{[-R|--recursive]}}` - Display help: diff --git a/pages/linux/free.md b/pages/linux/free.md index 8424c10daf..c3b4d71b80 100644 --- a/pages/linux/free.md +++ b/pages/linux/free.md @@ -13,8 +13,8 @@ - Display memory in human-readable units: -`free -h` +`free {{[-h|--human]}}` - Refresh the output every 2 seconds: -`free -s {{2}}` +`free {{[-s|--seconds]}} {{2}}` diff --git a/pages/linux/gpasswd.md b/pages/linux/gpasswd.md index 1fb9349bf8..fe6bebc7b8 100644 --- a/pages/linux/gpasswd.md +++ b/pages/linux/gpasswd.md @@ -5,11 +5,11 @@ - Define group administrators: -`sudo gpasswd -A {{user1,user2}} {{group}}` +`sudo gpasswd {{[-A|--administrators]}} {{user1,user2}} {{group}}` - Set the list of group members: -`sudo gpasswd -M {{user1,user2}} {{group}}` +`sudo gpasswd {{[-M|--members]}} {{user1,user2}} {{group}}` - Create a password for the named group: @@ -17,8 +17,8 @@ - Add a user to the named group: -`gpasswd -a {{user}} {{group}}` +`gpasswd {{[-a|--add]}} {{user}} {{group}}` - Remove a user from the named group: -`gpasswd -d {{user}} {{group}}` +`gpasswd {{[-d|--delete]}} {{user}} {{group}}` diff --git a/pages/linux/groupadd.md b/pages/linux/groupadd.md index 17aac0c653..1e2a92b7f1 100644 --- a/pages/linux/groupadd.md +++ b/pages/linux/groupadd.md @@ -10,8 +10,8 @@ - Create a new system group: -`sudo groupadd --system {{group_name}}` +`sudo groupadd {{[-r|--system]}} {{group_name}}` - Create a new group with the specific groupid: -`sudo groupadd --gid {{id}} {{group_name}}` +`sudo groupadd {{[-g|--gid]}} {{id}} {{group_name}}` diff --git a/pages/linux/groupmod.md b/pages/linux/groupmod.md index 3bc8f8b251..02b8666bca 100644 --- a/pages/linux/groupmod.md +++ b/pages/linux/groupmod.md @@ -6,8 +6,8 @@ - Change the group name: -`sudo groupmod --new-name {{new_group}} {{group_name}}` +`sudo groupmod {{[-n|--new-name]}} {{new_group}} {{group_name}}` - Change the group ID: -`sudo groupmod --gid {{new_id}} {{group_name}}` +`sudo groupmod {{[-g|--gid]}} {{new_id}} {{group_name}}` diff --git a/pages/linux/head.md b/pages/linux/head.md index 2f033487d9..8423ff0edf 100644 --- a/pages/linux/head.md +++ b/pages/linux/head.md @@ -5,16 +5,16 @@ - Output the first few lines of a file: -`head --lines {{count}} {{path/to/file}}` +`head {{[-n|--lines]}} {{count}} {{path/to/file}}` - Output the first few bytes of a file: -`head --bytes {{count}} {{path/to/file}}` +`head {{[-c|--bytes]}} {{count}} {{path/to/file}}` - Output everything but the last few lines of a file: -`head --lines -{{count}} {{path/to/file}}` +`head {{[-n|--lines]}} -{{count}} {{path/to/file}}` - Output everything but the last few bytes of a file: -`head --bytes -{{count}} {{path/to/file}}` +`head {{[-c|--bytes]}} -{{count}} {{path/to/file}}` diff --git a/pages/linux/lsblk.md b/pages/linux/lsblk.md index a33ce01c5a..593cd7a3b5 100644 --- a/pages/linux/lsblk.md +++ b/pages/linux/lsblk.md @@ -9,28 +9,28 @@ - Also list empty devices: -`lsblk -a` +`lsblk {{[-a|--all]}}` - Print the SIZE column in bytes rather than in a human-readable format: -`lsblk -b` +`lsblk {{[-b|--bytes]}}` - Output info about filesystems: -`lsblk -f` +`lsblk {{[-f|--fs]}}` - Use ASCII characters for tree formatting: -`lsblk -i` +`lsblk {{[-i|--ascii]}}` - Output info about block-device topology: -`lsblk -t` +`lsblk {{[-t|--topology]}}` - Exclude the devices specified by the comma-separated list of major device numbers: -`lsblk -e {{1,7,...}}` +`lsblk {{[-e|--exclude]}} {{1,7,...}}` - Display a customized summary using a comma-separated list of columns: -`lsblk --output {{NAME,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}` +`lsblk {{[-o|--output]}} {{NAME,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}` diff --git a/pages/linux/lscpu.md b/pages/linux/lscpu.md index 64b8618a12..981ebb07b3 100644 --- a/pages/linux/lscpu.md +++ b/pages/linux/lscpu.md @@ -9,8 +9,8 @@ - Display information in a table: -`lscpu --extended` +`lscpu {{[-e|--extended]}}` - Display only information about offline CPUs in a table: -`lscpu --extended --offline` +`lscpu {{[-e|--extended]}} {{[-c|--offline]}}` diff --git a/pages/linux/lsusb.md b/pages/linux/lsusb.md index 4a285ce2c2..33816e6a3e 100644 --- a/pages/linux/lsusb.md +++ b/pages/linux/lsusb.md @@ -9,15 +9,15 @@ - List the USB hierarchy as a tree: -`lsusb -t` +`lsusb {{[-t|--tree]}}` - List verbose information about USB devices: -`lsusb --verbose` +`lsusb {{[-V|--verbose]}}` - List detailed information about a USB device: -`lsusb --verbose -s {{bus}}:{{device number}}` +`lsusb {{[-V|--verbose]}} -s {{bus}}:{{device number}}` - List devices with a specified vendor and product ID only: diff --git a/pages/linux/lxc-create.md b/pages/linux/lxc-create.md index dc482f637c..a244ca557a 100644 --- a/pages/linux/lxc-create.md +++ b/pages/linux/lxc-create.md @@ -5,12 +5,12 @@ - Create a container interactively in `/var/lib/lxc/`: -`sudo lxc-create --name {{container}} --template download` +`sudo lxc-create {{[-n|--name]}} {{container}} {{[-t|--template]}} download` - Create a container in a target directory: -`sudo lxc-create --lxcpath {{/path/to/directory/}} --name {{container}} --template download` +`sudo lxc-create {{[-P|--lxcpath]}} {{/path/to/directory/}} {{[-n|--name]}} {{container}} {{[-t|--template]}} download` - Create a container passing options to a template: -`sudo lxc-create --name {{name}} --template download -- --dist {{distro-name}} --release {{release-version}} --arch {{arch}}` +`sudo lxc-create {{[-n|--name]}} {{name}} {{[-t|--template]}} download -- {{[-d|--dist]}} {{distro-name}} {{[-r|--release]}} {{release-version}} {{[-a|--arch]}} {{arch}}` diff --git a/pages/linux/lxc-ls.md b/pages/linux/lxc-ls.md index 00c223d596..63a4bd4b2f 100644 --- a/pages/linux/lxc-ls.md +++ b/pages/linux/lxc-ls.md @@ -21,4 +21,4 @@ - List containers in a fancy, column-based output: -`sudo lxc-ls --fancy` +`sudo lxc-ls {{[-f|--fancy]}}` diff --git a/pages/linux/poweroff.md b/pages/linux/poweroff.md index e5d2edaf30..b344755663 100644 --- a/pages/linux/poweroff.md +++ b/pages/linux/poweroff.md @@ -17,8 +17,8 @@ - Shut down immediately without contacting the system manager: -`poweroff --force` +`poweroff {{[-f|--force]}}` - Write the wtmp shutdown entry without shutting down the system: -`poweroff --wtmp-only` +`poweroff {{[-w|--wtmp-only]}}` diff --git a/pages/linux/rename.md b/pages/linux/rename.md index b7626a7427..84f875ae53 100644 --- a/pages/linux/rename.md +++ b/pages/linux/rename.md @@ -12,11 +12,11 @@ - Dry-run - display which renames would occur without performing them: -`rename -vn {{foo}} {{bar}} {{*}}` +`rename {{[-vn|--verbose --no-act]}} {{foo}} {{bar}} {{*}}` - Do not overwrite existing files: -`rename -o {{foo}} {{bar}} {{*}}` +`rename {{[-o|--no-overwrite]}} {{foo}} {{bar}} {{*}}` - Change file extensions: diff --git a/pages/linux/sed.md b/pages/linux/sed.md index eb3f5ecf6d..04897c43bd 100644 --- a/pages/linux/sed.md +++ b/pages/linux/sed.md @@ -10,24 +10,24 @@ - Replace all `apple` (extended regex) occurrences with `APPLE` (extended regex) in all input lines and print the result to `stdout`: -`{{command}} | sed -E 's/(apple)/\U\1/g'` +`{{command}} | sed {{[-E|--regexp-extended]}} 's/(apple)/\U\1/g'` - Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in a specific file and overwrite the original file in place: -`sed -i 's/apple/mango/g' {{path/to/file}}` +`sed {{[-i|--in-place]}} 's/apple/mango/g' {{path/to/file}}` -- Execute a specific script [f]ile and print the result to `stdout`: +- Execute a specific script file and print the result to `stdout`: -`{{command}} | sed -f {{path/to/script.sed}}` +`{{command}} | sed {{-f|--file}} {{path/to/script.sed}}` - Print just the first line to `stdout`: -`{{command}} | sed -n '1p'` +`{{command}} | sed {{[-n|--quiet]}} '1p'` - [d]elete the first line of a file: -`sed -i 1d {{path/to/file}}` +`sed {{[-i|--in-place]}} 1d {{path/to/file}}` - [i]nsert a new line at the first line of a file: -`sed -i '1i\your new line text\' {{path/to/file}}` +`sed {{[-i|--in-place]}} '1i\your new line text\' {{path/to/file}}` diff --git a/pages/linux/top.md b/pages/linux/top.md index 0fe325f9df..ad44ee6701 100644 --- a/pages/linux/top.md +++ b/pages/linux/top.md @@ -9,23 +9,23 @@ - Do not show any idle or zombie processes: -`top -i` +`top {{[-i|--idle-toggle]}}` - Show only processes owned by given user: -`top -u {{username}}` +`top {{[-u|--filter-only-euser]}} {{username}}` - Sort processes by a field: -`top -o {{field_name}}` +`top {{[-o|--sort-override]}} {{field_name}}` - Show the individual threads of a given process: -`top -Hp {{process_id}}` +`top {{[-Hp|--threads-show --pid]}} {{process_id}}` - Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name): -`top -p $(pgrep -d ',' {{process_name}})` +`top {{[-p|--pid]}} $(pgrep {{[-d|--delimiter]}} ',' {{process_name}})` - Display help about interactive commands: diff --git a/pages/linux/umount.md b/pages/linux/umount.md index 85b1eced28..24e173f29e 100644 --- a/pages/linux/umount.md +++ b/pages/linux/umount.md @@ -14,12 +14,12 @@ - When an unmount fails, try to remount the filesystem read-only: -`umount --read-only {{path/to/mounted_directory}}` +`umount {{[-r|--read-only]}} {{path/to/mounted_directory}}` - Recursively unmount each specified directory: -`umount --recursive {{path/to/mounted_directory}}` +`umount {{[-R|--recursive]}} {{path/to/mounted_directory}}` - Unmount all mounted filesystems (except the `proc` filesystem): -`umount -a` +`umount {{[-a|--all]}}` diff --git a/pages/linux/zip.md b/pages/linux/zip.md index b98e28c64d..55564bb7b9 100644 --- a/pages/linux/zip.md +++ b/pages/linux/zip.md @@ -6,28 +6,28 @@ - Add files/directories to a specific archive: -`zip -r {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` +`zip {{[-r|--recurse-paths}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Remove files/directories from a specific archive: -`zip --delete {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` +`zip {{[-d|--delete]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` -- Archive files/directories e[x]cluding specified ones: +- Archive files/directories excluding specified ones: -`zip {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} --exclude {{path/to/excluded_files_or_directories}}` +`zip {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} {{-x|--exclude}} {{path/to/excluded_files_or_directories}}` - Archive files/directories with a specific compression level (`0` - the lowest, `9` - the highest): -`zip -r -{{0..9}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` +`zip {{[-r|--recurse-paths]}} -{{0..9}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Create an encrypted archive with a specific password: -`zip -r --encrypt {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` +`zip {{[-r|--recurse-paths]}} {{[-e|--encrypt]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Archive files/directories to a multi-part [s]plit Zip archive (e.g. 3 GB parts): -`zip -r -s {{3g}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` +`zip {{[-r|--recurse-paths]}} {{[-s|--split-size]}} {{3g}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Print a specific archive contents: -`zip -sf {{path/to/compressed.zip}}` +`zip {{[-sf|--split-size --freshen]}} {{path/to/compressed.zip}}`