diff --git a/tldr/arp-scan b/tldr/arp-scan index bc74abe3..cf5f526c 100644 --- a/tldr/arp-scan +++ b/tldr/arp-scan @@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git - Scan the current local network: -`arp-scan --localnet` +`arp-scan {{[-l|--localnet]}}` - Scan an IP network with a custom bitmask: diff --git a/tldr/chgrp b/tldr/chgrp index 4ffdcb68..29e48d81 100644 --- a/tldr/chgrp +++ b/tldr/chgrp @@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/chmod b/tldr/chmod index ef4d3a65..fca349af 100644 --- a/tldr/chmod +++ b/tldr/chmod @@ -34,8 +34,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/chown b/tldr/chown index 5466baf6..a5208571 100644 --- a/tldr/chown +++ b/tldr/chown @@ -22,11 +22,11 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/cmp b/tldr/cmp index f715992b..ee0b4ad6 100644 --- a/tldr/cmp +++ b/tldr/cmp @@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/column b/tldr/column index 80015de3..3bfa0aad 100644 --- a/tldr/column +++ b/tldr/column @@ -13,23 +13,23 @@ source: https://github.com/tldr-pages/tldr.git `printf "header1 header2 bar foo -" | column --output-width {{30}}` +" | column {{[-c|--output-width]}} {{30}}` - Split columns automatically and auto-align them in a tabular format: `printf "header1 header2 bar foo -" | column --table` +" | column {{[-t|--table]}}` - Specify the column delimiter character for the `--table` option (e.g. "," for CSV) (defaults to whitespace): `printf "header1,header2 bar,foo -" | column --table --separator {{,}}` +" | column {{[-t|--table]}} {{[-s|--separator]}} {{,}}` - Fill rows before filling columns: `printf "header1 bar foobar -" | column --output-width {{30}} --fillrows` +" | column {{[-c|{{[-c|--output-width]}}]}} {{30}} {{[-x|--fillrows]}}` diff --git a/tldr/du b/tldr/du index 2a93d35a..1718cb8b 100644 --- a/tldr/du +++ b/tldr/du @@ -14,24 +14,24 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/ed b/tldr/ed index 13a4456b..24da26c2 100644 --- a/tldr/ed +++ b/tldr/ed @@ -15,19 +15,19 @@ source: https://github.com/tldr-pages/tldr.git - 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): @@ -35,4 +35,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/emacs b/tldr/emacs index e59bb146..fa13d6d2 100644 --- a/tldr/emacs +++ b/tldr/emacs @@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/ffmpeg b/tldr/ffmpeg index a1c4c3a7..fe093d15 100644 --- a/tldr/ffmpeg +++ b/tldr/ffmpeg @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - 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: @@ -26,16 +26,16 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/bridge b/tldr/linux/bridge new file mode 100644 index 00000000..7c3351de --- /dev/null +++ b/tldr/linux/bridge @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# bridge + +> Show and manipulate network bridge addresses and devices. +> More information: . + +- List all bridges and their interfaces: + +`bridge {{[l|link]}}` + +- Show port vlan information: + +`bridge {{[v|vlan]}}` + +- Assign a VLAN to a port: + +`sudo bridge {{[v|vlan]}} {{[a|add]}} dev {{lanX}} vid {{vlan_id}} pvid {{tagged|untagged}}` + +- Remove a VLAN from a port: + +`sudo bridge {{[v|vlan]}} {{[d|delete]}} dev {{lanX}} vid {{vlan_id}}` + +- Watch for changes in bridge interfaces: + +`bridge {{[mo|monitor]}}` diff --git a/tldr/linux/cp b/tldr/linux/cp index d1425312..167be58a 100644 --- a/tldr/linux/cp +++ b/tldr/linux/cp @@ -18,23 +18,23 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/dir b/tldr/linux/dir index d3358560..fc4cfee8 100644 --- a/tldr/linux/dir +++ b/tldr/linux/dir @@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git - List all files, including hidden files: -`dir --all` +`dir {{[-a|--all]}}` - List files including their author (`-l` is required): @@ -19,11 +19,11 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/free b/tldr/linux/free index 64540166..10f72c17 100644 --- a/tldr/linux/free +++ b/tldr/linux/free @@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/gpasswd b/tldr/linux/gpasswd index d0a606eb..03a724a7 100644 --- a/tldr/linux/gpasswd +++ b/tldr/linux/gpasswd @@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git - 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: @@ -22,8 +22,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/groupadd b/tldr/linux/groupadd index 32f0c49e..af094228 100644 --- a/tldr/linux/groupadd +++ b/tldr/linux/groupadd @@ -15,8 +15,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/groupmod b/tldr/linux/groupmod index de8b13f1..fefcfe1c 100644 --- a/tldr/linux/groupmod +++ b/tldr/linux/groupmod @@ -11,8 +11,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/head b/tldr/linux/head index 77bfe806..49644b48 100644 --- a/tldr/linux/head +++ b/tldr/linux/head @@ -10,16 +10,16 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/ip-link b/tldr/linux/ip-link index f5cfbb28..ba7f1c6a 100644 --- a/tldr/linux/ip-link +++ b/tldr/linux/ip-link @@ -31,3 +31,7 @@ source: https://github.com/tldr-pages/tldr.git - Change the MTU size for a network interface to use jumbo frames: `sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} mtu {{9000}}` + +- Set the promisc mode status of a device: + +`sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} promisc {{on|off}}` diff --git a/tldr/linux/lsblk b/tldr/linux/lsblk index 7bf9cccc..a2523be0 100644 --- a/tldr/linux/lsblk +++ b/tldr/linux/lsblk @@ -14,28 +14,28 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/lscpu b/tldr/linux/lscpu index 66580207..96c45d88 100644 --- a/tldr/linux/lscpu +++ b/tldr/linux/lscpu @@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/lsusb b/tldr/linux/lsusb index 86a32ab1..20f5cef2 100644 --- a/tldr/linux/lsusb +++ b/tldr/linux/lsusb @@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/lxc-create b/tldr/linux/lxc-create index e0b7c651..eef16eaf 100644 --- a/tldr/linux/lxc-create +++ b/tldr/linux/lxc-create @@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/lxc-ls b/tldr/linux/lxc-ls index 216b1ea9..cc17b677 100644 --- a/tldr/linux/lxc-ls +++ b/tldr/linux/lxc-ls @@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git - List containers in a fancy, column-based output: -`sudo lxc-ls --fancy` +`sudo lxc-ls {{[-f|--fancy]}}` diff --git a/tldr/linux/nstat b/tldr/linux/nstat new file mode 100644 index 00000000..02d3aabc --- /dev/null +++ b/tldr/linux/nstat @@ -0,0 +1,17 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# nstat + +> View network statistics. +> More information: . + +- View network statistics since last time `nstat` was run: + +`nstat` + +- View all-time network statistics: + +`nstat {{[-a|--ignore]}}` diff --git a/tldr/linux/poweroff b/tldr/linux/poweroff index ade1c6cf..0f9cac0b 100644 --- a/tldr/linux/poweroff +++ b/tldr/linux/poweroff @@ -22,8 +22,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/rename b/tldr/linux/rename index 66d201e6..ba3f96e2 100644 --- a/tldr/linux/rename +++ b/tldr/linux/rename @@ -17,11 +17,11 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/sed b/tldr/linux/sed index 909ec216..26447f1c 100644 --- a/tldr/linux/sed +++ b/tldr/linux/sed @@ -15,24 +15,24 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/top b/tldr/linux/top index 24bdbb9b..f432d806 100644 --- a/tldr/linux/top +++ b/tldr/linux/top @@ -14,23 +14,23 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/umount b/tldr/linux/umount index 8d70d904..cd16995e 100644 --- a/tldr/linux/umount +++ b/tldr/linux/umount @@ -19,12 +19,12 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/linux/zip b/tldr/linux/zip index 3e9a3476..5ae1a339 100644 --- a/tldr/linux/zip +++ b/tldr/linux/zip @@ -11,28 +11,28 @@ source: https://github.com/tldr-pages/tldr.git - 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}}` diff --git a/tldr/ln b/tldr/ln index 0455af3d..a1df00a0 100644 --- a/tldr/ln +++ b/tldr/ln @@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/ls b/tldr/ls index 87e5a863..4de90a71 100644 --- a/tldr/ls +++ b/tldr/ls @@ -12,30 +12,30 @@ source: https://github.com/tldr-pages/tldr.git `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/tldr/nano b/tldr/nano index e0ff8314..a4ea3292 100644 --- a/tldr/nano +++ b/tldr/nano @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - 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: @@ -26,12 +26,16 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/pgrep b/tldr/pgrep index 699607f5..76c400f2 100644 --- a/tldr/pgrep +++ b/tldr/pgrep @@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/pkill b/tldr/pkill index 89c613f0..d161ab2b 100644 --- a/tldr/pkill +++ b/tldr/pkill @@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git - 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): @@ -27,4 +27,4 @@ source: https://github.com/tldr-pages/tldr.git - Kill the main `firefox` process to close the browser: -`pkill --oldest "{{firefox}}"` +`pkill {{[-o|--oldest]}} "{{firefox}}"` diff --git a/tldr/pwd b/tldr/pwd index 1cbfa526..6d413247 100644 --- a/tldr/pwd +++ b/tldr/pwd @@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git - Print the current directory, and resolve all symlinks (i.e. show the "physical" path): -`pwd -P` +`pwd {{[-P|--physical]}}` diff --git a/tldr/snmpnetstat b/tldr/snmpnetstat new file mode 100644 index 00000000..2c216e0a --- /dev/null +++ b/tldr/snmpnetstat @@ -0,0 +1,13 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# snmpnetstat + +> Fetch networking status using SNMP. +> More information: . + +- Fetch the networking status: + +`snmpnetstat -v {{version}} -c {{community}} {{ip}}` diff --git a/tldr/sort b/tldr/sort index c0d52a62..fcf000d3 100644 --- a/tldr/sort +++ b/tldr/sort @@ -14,28 +14,28 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/tail b/tldr/tail index c22990ed..31e4e773 100644 --- a/tldr/tail +++ b/tldr/tail @@ -11,24 +11,24 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/tee b/tldr/tee index 5931b955..8c66845f 100644 --- a/tldr/tee +++ b/tldr/tee @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/touch b/tldr/touch index 26cf160f..61b62e8f 100644 --- a/tldr/touch +++ b/tldr/touch @@ -12,14 +12,14 @@ source: https://github.com/tldr-pages/tldr.git `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/tldr/uptime b/tldr/uptime index 1fe86ea9..2dddb81d 100644 --- a/tldr/uptime +++ b/tldr/uptime @@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/watch b/tldr/watch index 9d0e9e6f..8bbe5740 100644 --- a/tldr/watch +++ b/tldr/watch @@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git - 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: @@ -26,8 +26,8 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/wget b/tldr/wget index 7f462bb3..d40c5d1b 100644 --- a/tldr/wget +++ b/tldr/wget @@ -15,28 +15,28 @@ source: https://github.com/tldr-pages/tldr.git - 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/tldr/who b/tldr/who index e79394cc..ba2c23f2 100644 --- a/tldr/who +++ b/tldr/who @@ -15,8 +15,8 @@ source: https://github.com/tldr-pages/tldr.git - Display all available information: -`who -a` +`who {{[-a|--all]}}` - Display all available information with table headers: -`who -a -H` +`who {{[-aH|--all --heading]}}`