mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-04 18:44:04 +00:00
Update cheatsheets
This commit is contained in:
10
tldr/asdf
10
tldr/asdf
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# asdf
|
||||
|
||||
> Command-line interface for managing versions of different packages.
|
||||
> More information: <https://asdf-vm.com>.
|
||||
> More information: <https://asdf-vm.com/manage/commands.html>.
|
||||
|
||||
- List all available plugins:
|
||||
|
||||
@@ -26,8 +26,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Set global version for a package:
|
||||
|
||||
`asdf global {{name}} {{version}}`
|
||||
`asdf set -u {{name}} {{version}}`
|
||||
|
||||
- Set local version for a package:
|
||||
|
||||
`asdf local {{name}} {{version}}`
|
||||
`asdf set {{name}} {{version}}`
|
||||
|
||||
- See the current version used for a package:
|
||||
|
||||
`asdf current {{name}}`
|
||||
|
||||
4
tldr/at
4
tldr/at
@@ -9,10 +9,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Results will be sent to the users mail.
|
||||
> More information: <https://manned.org/at>.
|
||||
|
||||
- Start the `atd` daemon:
|
||||
|
||||
`systemctl start atd`
|
||||
|
||||
- Create commands interactively and execute them in 5 minutes (press `<Ctrl d>` when done):
|
||||
|
||||
`at now + 5 minutes`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# autoconf
|
||||
|
||||
> Generate configuration scripts to automatically configure software source code packages.
|
||||
> More information: <https://www.gnu.org/software/autoconf>.
|
||||
> More information: <https://manned.org/autoconf>.
|
||||
|
||||
- Generate a configuration script from `configure.ac` (if present) or `configure.in` and save this script to `configure`:
|
||||
|
||||
@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Generate a configuration script from the specified template (even if the input file has not changed) and write the output to a file:
|
||||
|
||||
`autoconf --force --output {{outfile}} {{template-file}}`
|
||||
`autoconf {{[-f|--force]}} {{[-o|--output]}} {{outfile}} {{template-file}}`
|
||||
|
||||
@@ -22,16 +22,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Read a file of BLAKE2 checksums and filenames and verify all files have matching checksums:
|
||||
|
||||
`b2sum --check {{path/to/file.b2}}`
|
||||
`b2sum {{[-c|--check]}} {{path/to/file.b2}}`
|
||||
|
||||
- Only show a message for missing files or when verification fails:
|
||||
|
||||
`b2sum --check --quiet {{path/to/file.b2}}`
|
||||
`b2sum {{[-c|--check]}} --quiet {{path/to/file.b2}}`
|
||||
|
||||
- Only show a message when verification fails, ignoring missing files:
|
||||
|
||||
`b2sum --ignore-missing --check --quiet {{path/to/file.b2}}`
|
||||
`b2sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.b2}}`
|
||||
|
||||
- Check a known BLAKE2 checksum of a file:
|
||||
|
||||
`echo {{known_blake2_checksum_of_the_file}} {{path/to/file}} | b2sum --check`
|
||||
`echo {{known_blake2_checksum_of_the_file}} {{path/to/file}} | b2sum {{[-c|--check]}}`
|
||||
|
||||
@@ -22,12 +22,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Read a file of BLAKE3 checksums and filenames and verify all files have matching checksums:
|
||||
|
||||
`b3sum --check {{path/to/file.b3}}`
|
||||
`b3sum {{[-c|--check]}} {{path/to/file.b3}}`
|
||||
|
||||
- Only show a message for missing files or when verification fails:
|
||||
|
||||
`b3sum --check --quiet {{path/to/file.b3}}`
|
||||
`b3sum {{[-c|--check]}} --quiet {{path/to/file.b3}}`
|
||||
|
||||
- Check a known BLAKE3 checksum of a file:
|
||||
|
||||
`echo {{known_blake3_checksum_of_the_file}} {{path/to/file}} | b3sum --check`
|
||||
`echo {{known_blake3_checksum_of_the_file}} {{path/to/file}} | b3sum {{[-c|--check]}}`
|
||||
|
||||
@@ -10,10 +10,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> See also: `at`, `atq`, `atrm` `mail`.
|
||||
> More information: <https://manned.org/batch>.
|
||||
|
||||
- Start the `atd` daemon:
|
||||
|
||||
`systemctl start atd`
|
||||
|
||||
- Execute commands from `stdin` (press `<Ctrl d>` when done):
|
||||
|
||||
`batch`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# bind
|
||||
|
||||
> Bash builtin to manage bash hotkeys and variables.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-bind>.
|
||||
|
||||
- List all bound commands and their hotkeys:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# bison
|
||||
|
||||
> GNU parser generator.
|
||||
> More information: <https://www.gnu.org/software/bison/>.
|
||||
> More information: <https://manned.org/bison>.
|
||||
|
||||
- Compile a bison definition file:
|
||||
|
||||
@@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Compile in debug mode, which causes the resulting parser to write additional information to `stdout`:
|
||||
|
||||
`bison --debug {{path/to/file.y}}`
|
||||
`bison {{[-t|--debug]}} {{path/to/file.y}}`
|
||||
|
||||
- Specify the output filename:
|
||||
|
||||
`bison --output {{path/to/output.c}} {{path/to/file.y}}`
|
||||
`bison {{[-o|--output]}} {{path/to/output.c}} {{path/to/file.y}}`
|
||||
|
||||
- Be verbose when compiling:
|
||||
|
||||
`bison --verbose`
|
||||
`bison {{[-v|--verbose]}}`
|
||||
|
||||
@@ -10,8 +10,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Run command as new root directory:
|
||||
|
||||
`chroot {{path/to/new/root}} {{command}}`
|
||||
`sudo chroot {{path/to/new/root}} {{command}}`
|
||||
|
||||
- Use a specific user and group:
|
||||
|
||||
`chroot --userspec={{username_or_id:group_name_or_id}}`
|
||||
`sudo chroot --userspec {{username_or_id:group_name_or_id}}`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# complete
|
||||
|
||||
> Get argument autocompletion to shell commands.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#index-complete>.
|
||||
|
||||
- Apply a function that performs autocompletion to a command:
|
||||
|
||||
|
||||
2
tldr/cvs
2
tldr/cvs
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# cvs
|
||||
|
||||
> Concurrent Versions System, a revision control system.
|
||||
> More information: <https://cvs.nongnu.org>.
|
||||
> More information: <https://manned.org/cvs>.
|
||||
|
||||
- Create a new repository (requires the `CVSROOT` environment variable to be set externally):
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display the current date in UTC, using the ISO 8601 format:
|
||||
|
||||
`date -u +%Y-%m-%dT%H:%M:%S%Z`
|
||||
`date {{[-u|--utc]}} +%Y-%m-%dT%H:%M:%S%Z`
|
||||
|
||||
- Display the current date as a Unix timestamp (seconds since the Unix epoch):
|
||||
|
||||
@@ -22,11 +22,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Convert a date specified as a Unix timestamp to the default format:
|
||||
|
||||
`date -d @{{1473305798}}`
|
||||
`date {{[-d|--date]}} @{{1473305798}}`
|
||||
|
||||
- Convert a given date to the Unix timestamp format:
|
||||
|
||||
`date -d "{{2018-09-01 00:00}}" +%s --utc`
|
||||
`date {{[-d|--date]}} "{{2018-09-01 00:00}}" +%s {{[-u|--utc]}}`
|
||||
|
||||
- Display the current date using the RFC-3339 format (`YYYY-MM-DD hh:mm:ss TZ`):
|
||||
|
||||
|
||||
8
tldr/dc
8
tldr/dc
@@ -19,16 +19,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Calculate an expression with the specified scale:
|
||||
|
||||
`dc --expression='{{10}} k {{5 3 /}} p'`
|
||||
`dc {{[-e|--expression]}} '{{10}} k {{5 3 /}} p'`
|
||||
|
||||
- Calculate 4 times 5 (4 5 *), subtract 17 (17 -), and [p]rint the output:
|
||||
|
||||
`dc --expression='4 5 * 17 - p'`
|
||||
`dc {{[-e|--expression]}} '4 5 * 17 - p'`
|
||||
|
||||
- Specify the number of decimal places to 7 (7 k), calculate 5 divided by -3 (5 _3 /) and [p]rint:
|
||||
|
||||
`dc --expression='7 k 5 _3 / p'`
|
||||
`dc {{[-e|--expression]}} '7 k 5 _3 / p'`
|
||||
|
||||
- Calculate the golden ratio, phi: set number of decimal places to 100 (100 k), square root of 5 (5 v) plus 1 (1 +), divided by 2 (2 /), and [p]rint result:
|
||||
|
||||
`dc --expression='100 k 5 v 1 + 2 / p'`
|
||||
`dc {{[-e|--expression]}} '100 k 5 v 1 + 2 / p'`
|
||||
|
||||
@@ -22,12 +22,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Output commands for Bourne shell:
|
||||
|
||||
`dircolors --bourne-shell`
|
||||
`dircolors {{[-b|--bourne-shell]}}`
|
||||
|
||||
- Output commands for C shell:
|
||||
|
||||
`dircolors --c-shell`
|
||||
`dircolors {{[-c|--c-shell]}}`
|
||||
|
||||
- View the default colors for file types and extensions:
|
||||
|
||||
`dircolors --print-data`
|
||||
`dircolors {{[-p|--print-database]}}`
|
||||
|
||||
@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Delimit output with a NUL character instead of a newline (useful when combining with `xargs`):
|
||||
|
||||
`dirname --zero {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`dirname {{[-z|--zero]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
@@ -15,20 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Open a file in console mode (without an X window):
|
||||
|
||||
`emacsclient --no-window-system {{path/to/file}}`
|
||||
`emacsclient {{[-nw|--no-window-system]}} {{path/to/file}}`
|
||||
|
||||
- Open a file in a new Emacs window:
|
||||
|
||||
`emacsclient --create-frame {{path/to/file}}`
|
||||
`emacsclient {{[-c|--create-frame]}} {{path/to/file}}`
|
||||
|
||||
- Evaluate a command, printing the output to `stdout`, and then quit:
|
||||
|
||||
`emacsclient --eval '({{command}})'`
|
||||
`emacsclient {{[-e|--eval]}} '({{command}})'`
|
||||
|
||||
- Specify an alternative editor in case no Emacs server is running:
|
||||
|
||||
`emacsclient --alternate-editor {{editor}} {{path/to/file}}`
|
||||
`emacsclient {{[-a|--alternate-editor]}} {{editor}} {{path/to/file}}`
|
||||
|
||||
- Stop a running Emacs server and all its instances, asking for confirmation on unsaved files:
|
||||
|
||||
`emacsclient --eval '(save-buffers-kill-emacs)'`
|
||||
`emacsclient {{[-e|--eval]}} '(save-buffers-kill-emacs)'`
|
||||
|
||||
@@ -6,19 +6,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# enscript
|
||||
|
||||
> Convert text files to PostScript, HTML, RTF, ANSI, and overstrikes.
|
||||
> More information: <https://www.gnu.org/software/enscript>.
|
||||
> More information: <https://manned.org/enscript>.
|
||||
|
||||
- Generate a PostScript file from a text file:
|
||||
|
||||
`enscript {{path/to/input_file}} --output={{path/to/output_file}}`
|
||||
`enscript {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
|
||||
|
||||
- Generate a file in a different language than PostScript:
|
||||
|
||||
`enscript {{path/to/input_file}} --language={{html|rtf|...}} --output={{path/to/output_file}}`
|
||||
`enscript {{path/to/input_file}} {{[-w|--language]}} {{html|rtf|...}} {{[-o|--output]}} {{path/to/output_file}}`
|
||||
|
||||
- Generate a PostScript file with a landscape layout, splitting the page into columns (maximum 9):
|
||||
|
||||
`enscript {{path/to/input_file}} --columns={{num}} --landscape --output={{path/to/output_file}}`
|
||||
`enscript {{path/to/input_file}} --columns {{num}} {{[-r|--landscape]}} {{[-o|--output]}} {{path/to/output_file}}`
|
||||
|
||||
- Display available syntax highlighting languages and file formats:
|
||||
|
||||
@@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Generate a PostScript file with syntax highlighting and color for a specified language:
|
||||
|
||||
`enscript {{path/to/input_file}} --color=1 --highlight={{language}} --output={{path/to/output_file}}`
|
||||
`enscript {{path/to/input_file}} --color 1 {{[-E|--highlight]}} {{language}} {{[-o|--output]}} {{path/to/output_file}}`
|
||||
|
||||
4
tldr/env
4
tldr/env
@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Clear the environment and run a program:
|
||||
|
||||
`env -i {{program}}`
|
||||
`env {{[-i|--ignore-environment]}} {{program}}`
|
||||
|
||||
- Remove variable from the environment and run a program:
|
||||
|
||||
`env -u {{variable}} {{program}}`
|
||||
`env {{[-u|--unset]}} {{variable}} {{program}}`
|
||||
|
||||
- Set a variable and run a program:
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Do not convert tabs after non blanks:
|
||||
|
||||
`expand -i {{path/to/file}}`
|
||||
`expand {{[-i|--initial]}} {{path/to/file}}`
|
||||
|
||||
- Have tabs a certain number of characters apart, not 8:
|
||||
|
||||
`expand -t {{number}} {{path/to/file}}`
|
||||
`expand {{[-t|--tabs]}} {{number}} {{path/to/file}}`
|
||||
|
||||
- Use a comma separated list of explicit tab positions:
|
||||
|
||||
`expand -t {{1,4,6}}`
|
||||
`expand {{[-t|--tabs]}} {{1,4,6}}`
|
||||
|
||||
10
tldr/fgrep
10
tldr/fgrep
@@ -15,20 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Search only lines that match entirely in one or more files:
|
||||
|
||||
`fgrep -x {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`fgrep {{[-x|--line-regexp]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Count the number of lines that match the given string in a file:
|
||||
|
||||
`fgrep -c {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-c|--count]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Show the line number in the file along with the line matched:
|
||||
|
||||
`fgrep -n {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-n|--line-number]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Display all lines except those that contain the search string:
|
||||
|
||||
`fgrep -v {{search_string}} {{path/to/file}}`
|
||||
`fgrep {{[-v|--invert-match]}} {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Display filenames whose content matches the search string at least once:
|
||||
|
||||
`fgrep -l {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`fgrep {{[-l|--files-with-matches]}} {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
6
tldr/fmt
6
tldr/fmt
@@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Reformat a file producing output lines of (at most) `n` characters:
|
||||
|
||||
`fmt -w {{n}} {{path/to/file}}`
|
||||
`fmt {{[-w|--width]}} {{n}} {{path/to/file}}`
|
||||
|
||||
- Reformat a file without joining lines shorter than the given width together:
|
||||
|
||||
`fmt -s {{path/to/file}}`
|
||||
`fmt {{[-s|--split-only]}} {{path/to/file}}`
|
||||
|
||||
- Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs):
|
||||
|
||||
`fmt -u {{path/to/file}}`
|
||||
`fmt {{[-u|--uniform-spacing]}} {{path/to/file}}`
|
||||
|
||||
21
tldr/freebsd/ipmitool
Normal file
21
tldr/freebsd/ipmitool
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, freebsd]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ipmitool
|
||||
|
||||
> Interface with the Intelligent Platform Management Interface (IPMI).
|
||||
> More information: <https://man.freebsd.org/cgi/man.cgi?query=ipmitool>.
|
||||
|
||||
- Load the IPMI kernel module for local connections:
|
||||
|
||||
`kldload ipmi.ko`
|
||||
|
||||
- Open IPMI shell on the local hardware :
|
||||
|
||||
`ipmitool shell`
|
||||
|
||||
- Open IPMI shell on a remote host:
|
||||
|
||||
`ipmitool -H {{ip_address}} -U {{user_name}} shell`
|
||||
16
tldr/glances
16
tldr/glances
@@ -14,16 +14,24 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Run in web server mode to show results in browser:
|
||||
|
||||
`glances -w`
|
||||
`glances {{[-w|--webserver]}}`
|
||||
|
||||
- Run in server mode to allow connections from other Glances clients:
|
||||
|
||||
`glances -s`
|
||||
`glances {{[-s|--server]}}`
|
||||
|
||||
- Connect to a Glances server:
|
||||
|
||||
`glances -c {{hostname}}`
|
||||
`glances {{[-c|--client]}} {{hostname}}`
|
||||
|
||||
- Require a password in (web) server mode:
|
||||
|
||||
`glances -s --password`
|
||||
`glances {{[-s|--server]}} --password`
|
||||
|
||||
- Exit Glances:
|
||||
|
||||
`<q>`
|
||||
|
||||
- Display help:
|
||||
|
||||
`glances {{[-h|--help]}}`
|
||||
|
||||
@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Persist the graph plot preview window after gnuplot exits:
|
||||
|
||||
`gnuplot --persist {{path/to/definition.plt}}`
|
||||
`gnuplot {{[-p|--persist]}} {{path/to/definition.plt}}`
|
||||
|
||||
2
tldr/gpg
2
tldr/gpg
@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create a GPG public and private key interactively:
|
||||
|
||||
`gpg --full-generate-key`
|
||||
`gpg {{[--full-gen-key|--full-generate-key]}}`
|
||||
|
||||
- List all keys from the public keyring:
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Encrypt a directory into `archive.gpg` using a passphrase:
|
||||
|
||||
`gpg-zip --symmetric --output {{archive.gpg}} {{path/to/directory}}`
|
||||
`gpg-zip {{[-c|--symmetric]}} {{[-o|--output]}} {{archive.gpg}} {{path/to/directory}}`
|
||||
|
||||
- Decrypt `archive.gpg` into a directory of the same name:
|
||||
|
||||
`gpg-zip --decrypt {{path/to/archive.gpg}}`
|
||||
`gpg-zip {{[-d|--decrypt]}} {{path/to/archive.gpg}}`
|
||||
|
||||
- List the contents of the encrypted `archive.gpg`:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- List the directories used by gpgconf:
|
||||
|
||||
`gpgconf --list-dirs`
|
||||
`gpgconf {{[-L|--list-dirs]}}`
|
||||
|
||||
- List all options of a component:
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Compile binary to default `a.out` with gprof information and run it to get `gmon.out`:
|
||||
|
||||
`gcc -pg {{program.c}} && ./a.out`
|
||||
`gcc {{[-p|-pg]}} {{program.c}} && ./a.out`
|
||||
|
||||
- Run gprof on default `a.out` and `gmon.out` to obtain profile output:
|
||||
|
||||
@@ -23,8 +23,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Suppress profile field's description:
|
||||
|
||||
`gprof -b`
|
||||
`gprof {{[-b|--brief]}}`
|
||||
|
||||
- Display routines that have zero usage:
|
||||
|
||||
`gprof -bz`
|
||||
`gprof {{[-bz|--brief --display-unused-functions]}}`
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# groff
|
||||
|
||||
> GNU replacement for the `troff` and `nroff` typesetting utilities.
|
||||
> More information: <https://www.gnu.org/software/groff>.
|
||||
> More information: <https://www.gnu.org/software/groff/manual/groff.html.node/Groff-Options.html>.
|
||||
|
||||
- Format output for a PostScript printer, saving the output to a file:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# hello
|
||||
|
||||
> Print "Hello, world!", "hello, world" or a customizable text.
|
||||
> More information: <https://www.gnu.org/software/hello/>.
|
||||
> More information: <https://www.gnu.org/software/hello/manual/html_node/Invoking-hello.html>.
|
||||
|
||||
- Print "Hello, world!":
|
||||
|
||||
@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Print "hello, world", the traditional type:
|
||||
|
||||
`hello --traditional`
|
||||
`hello {{[-t|--traditional]}}`
|
||||
|
||||
- Print a text message:
|
||||
|
||||
`hello --greeting="{{greeting_text}}"`
|
||||
`hello {{[-g|--greeting]}} "{{greeting_text}}"`
|
||||
|
||||
@@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Specify the "name" paragraph in the man page:
|
||||
|
||||
`help2man {{executable}} --name {{name}}`
|
||||
`help2man {{executable}} {{[-n|--name]}} {{name}}`
|
||||
|
||||
- Specify the section for the man page (defaults to 1):
|
||||
|
||||
`help2man {{executable}} --section {{section}}`
|
||||
`help2man {{executable}} {{[-s|--section]}} {{section}}`
|
||||
|
||||
- Output to a file instead of `stdout`:
|
||||
|
||||
`help2man {{executable}} --output {{path/to/file}}`
|
||||
`help2man {{executable}} {{[-o|--output]}} {{path/to/file}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# history
|
||||
|
||||
> Command-line history.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Bash-History-Builtins.html>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Bash-History-Builtins.html#index-history>.
|
||||
|
||||
- Display the commands history list with line numbers:
|
||||
|
||||
|
||||
@@ -6,16 +6,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# indent
|
||||
|
||||
> Change the appearance of a C/C++ program by inserting or deleting whitespace.
|
||||
> More information: <https://www.gnu.org/software/indent/>.
|
||||
> More information: <https://www.gnu.org/software/indent/manual/indent/Option-Summary.html>.
|
||||
|
||||
- Format C/C++ source according to the Linux style guide, automatically back up the original files, and replace with the indented versions:
|
||||
|
||||
`indent --linux-style {{path/to/source.c}} {{path/to/another_source.c}}`
|
||||
`indent {{[-linux|--linux-style]}} {{path/to/source.c}} {{path/to/another_source.c}}`
|
||||
|
||||
- Format C/C++ source according to the GNU style, saving the indented version to a different file:
|
||||
|
||||
`indent --gnu-style {{path/to/source.c}} -o {{path/to/indented_source.c}}`
|
||||
`indent {{[-gnu|--gnu-style]}} {{path/to/source.c}} -o {{path/to/indented_source.c}}`
|
||||
|
||||
- Format C/C++ source according to the style of Kernighan & Ritchie (K&R), no tabs, 3 spaces per indent, and wrap lines at 120 characters:
|
||||
|
||||
`indent --k-and-r-style --indent-level3 --no-tabs --line-length120 {{path/to/source.c}} -o {{path/to/indented_source.c}}`
|
||||
`indent {{[-kr|--k-and-r-style]}} {{[-il|--indent-level]}}3 {{[-nut|--no-tabs]}} {{[-l|--line-length]}}120 {{path/to/source.c}} -o {{path/to/indented_source.c}}`
|
||||
|
||||
@@ -15,19 +15,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Copy files to the destination, setting their ownership:
|
||||
|
||||
`install --owner {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
`install {{[-o|--owner]}} {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
|
||||
- Copy files to the destination, setting their group ownership:
|
||||
|
||||
`install --group {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
`install {{[-g|--group]}} {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
|
||||
- Copy files to the destination, setting their `mode`:
|
||||
|
||||
`install --mode {{+x}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
`install {{[-m|--mode]}} {{+x}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
|
||||
- Copy files and apply access/modification times of source to the destination:
|
||||
|
||||
`install --preserve-timestamps {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
`install {{[-p|--preserve-timestamps]}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
|
||||
|
||||
- Copy files and create the directories at the destination if they don't exist:
|
||||
|
||||
|
||||
17
tldr/ipmitool
Normal file
17
tldr/ipmitool
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ipmitool
|
||||
|
||||
> Interface with the Intelligent Platform Management Interface (IPMI).
|
||||
> More information: <https://manned.org/ipmitool>.
|
||||
|
||||
- Open IPMI shell on the local hardware :
|
||||
|
||||
`sudo ipmitool shell`
|
||||
|
||||
- Open IPMI shell on a remote host:
|
||||
|
||||
`ipmitool -H {{ip_address}} -U {{user_name}} shell`
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# jcal
|
||||
|
||||
> Display calendar information in the Jalali format, with the current day highlighted.
|
||||
> More information: <https://www.nongnu.org/jcal/>.
|
||||
> More information: <https://www.nongnu.org/jcal/jcal.html>.
|
||||
|
||||
- Display a calendar for the current month:
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Print how long users have been connected in hours:
|
||||
|
||||
`ac --individual-totals`
|
||||
`ac {{[-p|--individual-totals]}}`
|
||||
|
||||
- Print how long a particular user has been connected in hours:
|
||||
|
||||
`ac --individual-totals {{username}}`
|
||||
`ac {{[-p|--individual-totals]}} {{username}}`
|
||||
|
||||
- Print how long a particular user has been connected in hours per day (with total):
|
||||
|
||||
`ac --daily-totals --individual-totals {{username}}`
|
||||
`ac {{[-d|--daily-totals]}} {{[-p|--individual-totals]}} {{username}}`
|
||||
|
||||
- Also display additional details:
|
||||
|
||||
|
||||
@@ -5,21 +5,34 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# at
|
||||
|
||||
> Executes commands at a specified time.
|
||||
> More information: <https://manned.org/at.1>.
|
||||
> Execute commands once at a later time.
|
||||
> Results will be sent to the users mail.
|
||||
> More information: <https://manned.org/at>.
|
||||
|
||||
- Open an `at` prompt to create a new set of scheduled commands, press `Ctrl + D` to save and exit:
|
||||
- Start the `atd` daemon:
|
||||
|
||||
`systemctl start atd`
|
||||
|
||||
- Create commands interactively and execute them in 5 minutes (press `<Ctrl d>` when done):
|
||||
|
||||
`at now + 5 minutes`
|
||||
|
||||
- Create commands interactively and execute them at a specific time:
|
||||
|
||||
`at {{hh:mm}}`
|
||||
|
||||
- Execute the commands and email the result using a local mailing program such as Sendmail:
|
||||
- Execute a command from `stdin` at 10:00 AM today:
|
||||
|
||||
`at {{hh:mm}} -m`
|
||||
`echo "{{command}}" | at 1000`
|
||||
|
||||
- Execute a script at the given time:
|
||||
- Execute commands from a given file next Tuesday:
|
||||
|
||||
`at {{hh:mm}} -f {{path/to/file}}`
|
||||
`at -f {{path/to/file}} 9:30 PM Tue`
|
||||
|
||||
- Display a system notification at 11pm on February 18th:
|
||||
- List all queued jobs for the current user (same as `atq`):
|
||||
|
||||
`echo "notify-send '{{Wake up!}}'" | at {{11pm}} {{Feb 18}}`
|
||||
`at -l`
|
||||
|
||||
- View a specied job:
|
||||
|
||||
`at -c {{job_number}}`
|
||||
|
||||
@@ -6,20 +6,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# atool
|
||||
|
||||
> Manage archives of various formats.
|
||||
> More information: <https://www.nongnu.org/atool/>.
|
||||
> More information: <https://manned.org/man/atool>.
|
||||
|
||||
- List files in a Zip archive:
|
||||
|
||||
`atool --list {{path/to/archive.zip}}`
|
||||
`atool {{[-l|--list]}} {{path/to/archive.zip}}`
|
||||
|
||||
- Unpack a tar.gz archive into a new subdirectory (or current directory if it contains only one file):
|
||||
|
||||
`atool --extract {{path/to/archive.tar.gz}}`
|
||||
`atool {{[-x|--extract]}} {{path/to/archive.tar.gz}}`
|
||||
|
||||
- Create a new 7z archive with two files:
|
||||
|
||||
`atool --add {{path/to/archive.7z}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`atool {{[-a|--add]}} {{path/to/archive.7z}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Extract all Zip and rar archives in the current directory:
|
||||
|
||||
`atool --each --extract {{*.zip *.rar}}`
|
||||
`atool {{[-e|--each]}} {{[-E|--extract]}} {{*.zip *.rar}}`
|
||||
|
||||
23
tldr/linux/batch
Normal file
23
tldr/linux/batch
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# batch
|
||||
|
||||
> Execute commands at a later time when the system load levels permit.
|
||||
> Results will be sent to the user's mail.
|
||||
> See also: `at`, `atq`, `atrm` `mail`.
|
||||
> More information: <https://manned.org/batch>.
|
||||
|
||||
- Start the `atd` daemon:
|
||||
|
||||
`systemctl start atd`
|
||||
|
||||
- Execute commands from `stdin` (press `<Ctrl d>` when done):
|
||||
|
||||
`batch`
|
||||
|
||||
- Execute a command from `stdin`:
|
||||
|
||||
`echo "{{./make_db_backup.sh}}" | batch`
|
||||
@@ -11,11 +11,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- View security context of a file:
|
||||
|
||||
`ls -lZ {{path/to/file}}`
|
||||
`ls {{[-lZ|-l --context]}} {{path/to/file}}`
|
||||
|
||||
- Change the security context of a target file, using a reference file:
|
||||
|
||||
`chcon --reference={{reference_file}} {{target_file}}`
|
||||
`chcon --reference {{reference_file}} {{target_file}}`
|
||||
|
||||
- Change the full SELinux security context of a file:
|
||||
|
||||
@@ -23,16 +23,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Change only the user part of SELinux security context:
|
||||
|
||||
`chcon -u {{user}} {{filename}}`
|
||||
`chcon {{[-u|--user]}} {{user}} {{filename}}`
|
||||
|
||||
- Change only the role part of SELinux security context:
|
||||
|
||||
`chcon -r {{role}} {{filename}}`
|
||||
`chcon {{[-r|--role]}} {{role}} {{filename}}`
|
||||
|
||||
- Change only the type part of SELinux security context:
|
||||
|
||||
`chcon -t {{type}} {{filename}}`
|
||||
`chcon {{[-t|--type]}} {{type}} {{filename}}`
|
||||
|
||||
- Change only the range/level part of SELinux security context:
|
||||
|
||||
`chcon -l {{range/level}} {{filename}}`
|
||||
`chcon {{[-l|--range]}} {{range/level}} {{filename}}`
|
||||
|
||||
@@ -10,16 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Update a user's "Name" field in the output of `finger`:
|
||||
|
||||
`chfn -f {{new_display_name}} {{username}}`
|
||||
`chfn {{[-f|--full-name]}} {{new_display_name}} {{username}}`
|
||||
|
||||
- Update a user's "Office Room Number" field for the output of `finger`:
|
||||
|
||||
`chfn -o {{new_office_room_number}} {{username}}`
|
||||
`chfn {{[-o|--office]}} {{new_office_room_number}} {{username}}`
|
||||
|
||||
- Update a user's "Office Phone Number" field for the output of `finger`:
|
||||
|
||||
`chfn -p {{new_office_telephone_number}} {{username}}`
|
||||
`chfn {{[-p|--office-phone]}} {{new_office_telephone_number}} {{username}}`
|
||||
|
||||
- Update a user's "Home Phone Number" field for the output of `finger`:
|
||||
|
||||
`chfn -h {{new_home_telephone_number}} {{username}}`
|
||||
`chfn {{[-h|--home-phone]}} {{new_home_telephone_number}} {{username}}`
|
||||
|
||||
@@ -19,11 +19,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Split a file every 5 lines, ignoring exact-division error:
|
||||
|
||||
`csplit -k {{path/to/file}} 5 {*}`
|
||||
`csplit {{[-k|--keep-files]}} {{path/to/file}} 5 {*}`
|
||||
|
||||
- Split a file at line 5 and use a custom prefix for the output files:
|
||||
|
||||
`csplit {{path/to/file}} 5 -f {{prefix}}`
|
||||
`csplit {{path/to/file}} 5 {{[-f|--prefix]}} {{prefix}}`
|
||||
|
||||
- Split a file at a line matching a regular expression:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# datamash
|
||||
|
||||
> Perform basic numeric, textual and statistical operations on input textual data files.
|
||||
> More information: <https://www.gnu.org/software/datamash/>.
|
||||
> More information: <https://www.gnu.org/software/datamash/manual/html_node/Invoking-datamash.html>.
|
||||
|
||||
- Get max, min, mean and median of a single column of numbers:
|
||||
|
||||
@@ -28,7 +28,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
3
|
||||
4
|
||||
5
|
||||
5' | datamash -R {{number_of_decimals_wanted}} mean 1`
|
||||
5' | datamash {{[-R|--round]}} {{number_of_decimals_wanted}} mean 1`
|
||||
|
||||
- Get the mean of a single column of numbers ignoring "Na" and "NaN" (literal) strings:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# ddrescue
|
||||
|
||||
> Data recovery tool that reads data from damaged block devices.
|
||||
> More information: <https://www.gnu.org/software/ddrescue/>.
|
||||
> More information: <https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html#Invoking-ddrescue>.
|
||||
|
||||
- Take an image of a device, creating a log file:
|
||||
|
||||
@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Clone Disk A to Disk B, creating a log file:
|
||||
|
||||
`sudo ddrescue --force --no-scrape {{/dev/sdX}} {{/dev/sdY}} {{path/to/log.txt}}`
|
||||
`sudo ddrescue {{[-f|--force]}} {{[-n|--no-scrape]}} {{/dev/sdX}} {{/dev/sdY}} {{path/to/log.txt}}`
|
||||
|
||||
@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Show all changes, outlining conflicts:
|
||||
|
||||
`diff3 --show-all {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`
|
||||
`diff3 {{[-A|--show-all]}} {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}`
|
||||
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Fold lines in a fixed width:
|
||||
|
||||
`fold --width {{width}} {{path/to/file}}`
|
||||
`fold {{[-w|--width]}} {{width}} {{path/to/file}}`
|
||||
|
||||
- Count width in bytes (the default is to count in columns):
|
||||
|
||||
`fold --bytes --width {{width_in_bytes}} {{path/to/file}}`
|
||||
`fold {{[-b|--bytes]}} {{[-w|--width]}} {{width_in_bytes}} {{path/to/file}}`
|
||||
|
||||
- Break the line after the rightmost blank within the width limit:
|
||||
|
||||
`fold --spaces --width {{width}} {{path/to/file}}`
|
||||
`fold {{[-s|--spaces]}} {{[-w|--width]}} {{width}} {{path/to/file}}`
|
||||
|
||||
@@ -15,20 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Write individual execution counts for every basic block:
|
||||
|
||||
`gcov --all-blocks {{path/to/file.cpp}}`
|
||||
`gcov {{[-a|--all-blocks]}} {{path/to/file.cpp}}`
|
||||
|
||||
- Write branch frequencies to the output file and print summary information to `stdout` as a percentage:
|
||||
|
||||
`gcov --branch-probabilities {{path/to/file.cpp}}`
|
||||
`gcov {{[-b|--branch-probabilities]}} {{path/to/file.cpp}}`
|
||||
|
||||
- Write branch frequencies as the number of branches taken, rather than the percentage:
|
||||
|
||||
`gcov --branch-counts {{path/to/file.cpp}}`
|
||||
`gcov {{[-c|--branch-counts]}} {{path/to/file.cpp}}`
|
||||
|
||||
- Do not create a `gcov` output file:
|
||||
|
||||
`gcov --no-output {{path/to/file.cpp}}`
|
||||
`gcov {{[-n|--no-output]}} {{path/to/file.cpp}}`
|
||||
|
||||
- Write file level as well as function level summaries:
|
||||
|
||||
`gcov --function-summaries {{path/to/file.cpp}}`
|
||||
`gcov {{[-f|--function-summaries]}} {{path/to/file.cpp}}`
|
||||
|
||||
@@ -6,20 +6,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# getopt
|
||||
|
||||
> Parse command-line arguments.
|
||||
> More information: <https://www.gnu.org/software/libc/manual/html_node/Getopt.html>.
|
||||
> More information: <https://manned.org/getopt>.
|
||||
|
||||
- Parse optional `verbose`/`version` flags with shorthands:
|
||||
|
||||
`getopt --options vV --longoptions verbose,version -- --version --verbose`
|
||||
`getopt {{[-o|--options]}} vV {{[-l|--longoptions]}} verbose,version -- --version --verbose`
|
||||
|
||||
- Add a `--file` option with a required argument with shorthand `-f`:
|
||||
|
||||
`getopt --options f: --longoptions file: -- --file=somefile`
|
||||
`getopt {{[-o|--options]}} f: {{[-l|--longoptions]}} file: -- --file=somefile`
|
||||
|
||||
- Add a `--verbose` option with an optional argument with shorthand `-v`, and pass a non-option parameter `arg`:
|
||||
|
||||
`getopt --options v:: --longoptions verbose:: -- --verbose arg`
|
||||
`getopt {{[-o|--options]}} v:: {{[-l|--longoptions]}} verbose:: -- --verbose arg`
|
||||
|
||||
- Accept a `-r` and `--verbose` flag, a `--accept` option with an optional argument and add a `--target` with a required argument option with shorthands:
|
||||
|
||||
`getopt --options rv::s::t: --longoptions verbose,source::,target: -- -v --target target`
|
||||
`getopt {{[-o|--options]}} rv::s::t: {{[-l|--longoptions]}} verbose,source::,target: -- -v --target target`
|
||||
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Install GRUB on a BIOS system:
|
||||
|
||||
`grub-install --target={{i386-pc}} {{path/to/device}}`
|
||||
`grub-install --target {{i386-pc}} {{path/to/device}}`
|
||||
|
||||
- Install GRUB on an UEFI system:
|
||||
|
||||
`grub-install --target={{x86_64-efi}} --efi-directory={{path/to/efi_directory}} --bootloader-id={{GRUB}}`
|
||||
`grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --bootloader-id {{GRUB}}`
|
||||
|
||||
- Install GRUB pre-loading specific modules:
|
||||
|
||||
`grub-install --target={{x86_64-efi}} --efi-directory={{path/to/efi_directory}} --modules="{{part_gpt part_msdos}}"`
|
||||
`grub-install --target {{x86_64-efi}} --efi-directory {{path/to/efi_directory}} --modules "{{part_gpt part_msdos}}"`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Generate the configuration file:
|
||||
|
||||
`sudo grub-mkconfig --output={{/boot/grub/grub.cfg}}`
|
||||
`sudo grub-mkconfig {{[-o|--output]}} {{/boot/grub/grub.cfg}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display each line of input after reading it:
|
||||
|
||||
`grub-script-check --verbose`
|
||||
`grub-script-check {{[-v|--verbose]}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
|
||||
@@ -10,23 +10,23 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Install a new package:
|
||||
|
||||
`guix package -i {{package}}`
|
||||
`guix package {{[-i|--install]}} {{package}}`
|
||||
|
||||
- Remove a package:
|
||||
|
||||
`guix package -r {{package}}`
|
||||
`guix package {{[-r|--remove]}} {{package}}`
|
||||
|
||||
- Search the package database for a regular expression:
|
||||
|
||||
`guix package -s "{{search_pattern}}"`
|
||||
`guix package {{[-s|--search]}} "{{search_pattern}}"`
|
||||
|
||||
- List installed packages:
|
||||
|
||||
`guix package -I`
|
||||
`guix package {{[-I|--list-installed]}}`
|
||||
|
||||
- List generations:
|
||||
|
||||
`guix package -l`
|
||||
`guix package {{[-l|--list-generations]}}`
|
||||
|
||||
- Roll back to the previous generation:
|
||||
|
||||
|
||||
@@ -17,26 +17,26 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`ipcs {{--shmems|--queues|--semaphores}}`
|
||||
|
||||
- Show full details on the resource with a specific [i]D:
|
||||
- Show full details on the resource with a specific ID:
|
||||
|
||||
`ipcs {{--shmems|--queues|--semaphores}} --id {{resource_id}}`
|
||||
`ipcs {{--shmems|--queues|--semaphores}} {{[-i|--id]}} {{resource_id}}`
|
||||
|
||||
- Show [l]imits in [b]ytes or in a human-readable format:
|
||||
- Show limits in [b]ytes or in a human-readable format:
|
||||
|
||||
`ipcs --limits {{--bytes|--human}}`
|
||||
`ipcs {{[-l|--limits]}} {{--bytes|--human}}`
|
||||
|
||||
- Show s[u]mmary about current usage:
|
||||
|
||||
`ipcs --summary`
|
||||
`ipcs {{[-u|--summary]}}`
|
||||
|
||||
- Show [c]reator's and owner's UIDs and PIDs for all IPC facilities:
|
||||
- Show creator's and owner's UIDs and PIDs for all IPC facilities:
|
||||
|
||||
`ipcs --creator`
|
||||
`ipcs {{[-c|--creator]}}`
|
||||
|
||||
- Show the [p]ID of the last operators for all IPC facilities:
|
||||
- Show the PID of the last operators for all IPC facilities:
|
||||
|
||||
`ipcs --pid`
|
||||
`ipcs {{[-p|--pid]}}`
|
||||
|
||||
- Show last access [t]imes for all IPC facilities:
|
||||
- Show last access times for all IPC facilities:
|
||||
|
||||
`ipcs --time`
|
||||
`ipcs {{[-t|--time]}}`
|
||||
|
||||
21
tldr/linux/ipmitool
Normal file
21
tldr/linux/ipmitool
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ipmitool
|
||||
|
||||
> Interface with the Intelligent Platform Management Interface (IPMI).
|
||||
> More information: <https://manned.org/ipmitool>.
|
||||
|
||||
- Start the IPMI driver for local connections:
|
||||
|
||||
`systemctl start ipmidrv`
|
||||
|
||||
- Open IPMI shell on the local hardware :
|
||||
|
||||
`sudo ipmitool shell`
|
||||
|
||||
- Open IPMI shell on a remote host:
|
||||
|
||||
`ipmitool -H {{ip_address}} -U {{user_name}} shell`
|
||||
@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Compile a source file into a `libtool` object:
|
||||
|
||||
`libtool --mode=compile gcc -c {{path/to/source.c}} -o {{path/to/source.lo}}`
|
||||
`libtool --mode=compile gcc {{[-c|--compile]}} {{path/to/source.c}} {{[-o|--output]}} {{path/to/source.lo}}`
|
||||
|
||||
- Create a library or an executable:
|
||||
|
||||
`libtool --mode=link gcc -o {{path/to/library.lo}} {{path/to/source.lo}}`
|
||||
`libtool --mode=link gcc {{[-o|--output]}} {{path/to/library.lo}} {{path/to/source.lo}}`
|
||||
|
||||
- Automatically set the library path so that another program can use uninstalled `libtool` generated programs or libraries:
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Initialize a project for `libtool` by copying necessary files (avoiding symbolic links) and overwriting existing files if needed:
|
||||
|
||||
`libtoolize --copy --force`
|
||||
`libtoolize {{[-c|--copy]}} {{[-f|--force]}}`
|
||||
|
||||
@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create a device file with default SELinux security context:
|
||||
|
||||
`sudo mknod -Z {{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}`
|
||||
`sudo mknod {{[-Z |--context=]}}{{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Use a custom directory (defaults to `$TMPDIR`, or `/tmp`):
|
||||
|
||||
`mktemp --tmpdir={{/path/to/tempdir}}`
|
||||
`mktemp {{[-p |--tmpdir=]}}{{/path/to/tempdir}}`
|
||||
|
||||
- Use a custom path template (`X`s are replaced with random alphanumeric characters):
|
||||
|
||||
|
||||
@@ -7,19 +7,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> A partition manipulation program.
|
||||
> See also: `parted-interactive`, `partprobe`.
|
||||
> More information: <https://www.gnu.org/software/parted/parted.html>.
|
||||
> More information: <https://www.gnu.org/software/parted/manual/html_node/Invoking-Parted.html>.
|
||||
|
||||
- List partitions on all block devices:
|
||||
|
||||
`sudo parted --list`
|
||||
`sudo parted {{[-l|--list]}}`
|
||||
|
||||
- Create a new partition table of the specified label-type:
|
||||
|
||||
`sudo parted {{/dev/sdX}} --script mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}`
|
||||
`sudo parted {{/dev/sdX}} {{[-s|--script]}} mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}`
|
||||
|
||||
- Create a new `gpt` partition table with a 500MiB boot partition and give the rest for the system partition:
|
||||
|
||||
`sudo parted {{/dev/sdX}} --script mklabel gpt mkpart primary 0% 500MiB mkpart primary 500MiB 100%`
|
||||
`sudo parted {{/dev/sdX}} {{[-s|--script]}} mklabel gpt mkpart primary 0% 500MiB mkpart primary 500MiB 100%`
|
||||
|
||||
- Start interactive mode with the specified disk selected:
|
||||
|
||||
|
||||
@@ -10,20 +10,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Generate a permuted index where the first field of each line is an index reference:
|
||||
|
||||
`ptx --references {{path/to/file}}`
|
||||
`ptx {{[-r|--references]}} {{path/to/file}}`
|
||||
|
||||
- Generate a permuted index with automatically generated index references:
|
||||
|
||||
`ptx --auto-reference {{path/to/file}}`
|
||||
`ptx {{[-A|--auto-reference]}} {{path/to/file}}`
|
||||
|
||||
- Generate a permuted index with a fixed width:
|
||||
|
||||
`ptx --width={{width_in_columns}} {{path/to/file}}`
|
||||
`ptx {{[-w|--width]}} {{width_in_columns}} {{path/to/file}}`
|
||||
|
||||
- Generate a permuted index with a list of filtered words:
|
||||
|
||||
`ptx --only-file={{path/to/filter}} {{path/to/file}}`
|
||||
`ptx {{[-o|--only-file]}} {{path/to/filter}} {{path/to/file}}`
|
||||
|
||||
- Generate a permuted index with SYSV-style behaviors:
|
||||
|
||||
`ptx --traditional {{path/to/file}}`
|
||||
`ptx {{[-G|--traditional]}} {{path/to/file}}`
|
||||
|
||||
@@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Change the log output file:
|
||||
|
||||
`pw-profiler --output {{path/to/file.log}}`
|
||||
`pw-profiler {{[-o|--output]}} {{path/to/file.log}}`
|
||||
|
||||
- Profile a remote instance:
|
||||
|
||||
`pw-profiler --remote {{remote_name}}`
|
||||
`pw-profiler {{[-r|--remote]}} {{remote_name}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`pw-profiler --help`
|
||||
`pw-profiler {{[-h|--help]}}`
|
||||
|
||||
@@ -15,12 +15,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Copy a directory recursively:
|
||||
|
||||
`rcp -r {{path/to/local_directory}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
`rcp {{[-r|--recursive]}} {{path/to/local_directory}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
|
||||
- Preserve the file attributes:
|
||||
|
||||
`rcp -p {{path/to/local_file}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
`rcp {{[-p|--preserve]}} {{path/to/local_file}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
|
||||
- Force copy without a confirmation:
|
||||
|
||||
`rcp -f {{path/to/local_file}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
`rcp {{[-f|--from]}} {{path/to/local_file}} {{username}}@{{remote_host}}:{{/path/to/destination/}}`
|
||||
|
||||
@@ -9,18 +9,18 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Note: Use `rexec` with caution, as it transmits data in plain text. Consider secure alternatives like SSH for encrypted communication.
|
||||
> More information: <https://www.gnu.org/software/inetutils/manual/html_node/rexec-invocation.html>.
|
||||
|
||||
- Execute a command on a remote [h]ost:
|
||||
- Execute a command on a remote host:
|
||||
|
||||
`rexec -h={{remote_host}} {{ls -l}}`
|
||||
`rexec {{[-h|--host]}} {{remote_host}} {{ls -l}}`
|
||||
|
||||
- Specify the remote [u]sername on a remote [h]ost:
|
||||
- Specify the remote username on a remote host:
|
||||
|
||||
`rexec -username={{username}} -h={{remote_host}} {{ps aux}}`
|
||||
`rexec {{[-u|--username]}} {{username}} {{[-h|--host]}} {{remote_host}} {{ps aux}}`
|
||||
|
||||
- Redirect `stdin` from `/dev/null` on a remote [h]ost:
|
||||
- Redirect `stdin` from `/dev/null` on a remote host:
|
||||
|
||||
`rexec --no-err -h={{remote_host}} {{ls -l}}`
|
||||
`rexec {{[-n|--noerr]}} {{[-h|--host]}} {{remote_host}} {{ls -l}}`
|
||||
|
||||
- Specify the remote [P]ort on a remote [h]ost:
|
||||
- Specify the remote port on a remote host:
|
||||
|
||||
`rexec -P={{1234}} -h={{remote_host}} {{ls -l}}`
|
||||
`rexec {{[-P|--port]}} {{1234}} {{[-h|--host]}} {{remote_host}} {{ls -l}}`
|
||||
|
||||
@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Log in to a remote host with a specific username:
|
||||
|
||||
`rlogin -l {{username}} {{remote_host}}`
|
||||
`rlogin {{[-l|--user]}} {{username}} {{remote_host}}`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Execute a command on a remote host with a specific username:
|
||||
|
||||
`rsh {{remote_host}} -l {{username}} {{ls -l}}`
|
||||
`rsh {{remote_host}} {{[-l|--user]}} {{username}} {{ls -l}}`
|
||||
|
||||
- Redirect `stdin` to `/dev/null` when executing a command on a remote host:
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Specify the domain to run a command in:
|
||||
|
||||
`runcon -t {{domain}}_t {{command}}`
|
||||
`runcon {{[-t|--type]}} {{domain}}_t {{command}}`
|
||||
|
||||
- Specify the context role to run a command with:
|
||||
|
||||
`runcon -r {{role}}_r {{command}}`
|
||||
`runcon {{[-r|--role]}} {{role}}_r {{command}}`
|
||||
|
||||
- Specify the full context to run a command with:
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Execute a specific script file and print the result to `stdout`:
|
||||
|
||||
`{{command}} | sed {{-f|--file}} {{path/to/script.sed}}`
|
||||
`{{command}} | sed {{[-f|--file]}} {{path/to/script.sed}}`
|
||||
|
||||
- Print just the first line to `stdout`:
|
||||
|
||||
|
||||
@@ -10,20 +10,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create a shell script that when executed extracts the given files from itself:
|
||||
|
||||
`shar --vanilla-operation {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
`shar {{[-V|--vanilla-operation]}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
|
||||
- Compress the files in the archive:
|
||||
|
||||
`shar --compactor {{xz}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
`shar {{[-C|--compactor]}} {{xz}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
|
||||
- Treat all files as binary (i.e. `uuencode` everything):
|
||||
|
||||
`shar --uuencode {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
`shar {{[-B|--uuencode]}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
|
||||
- Treat all files as text (i.e. `uuencode` nothing):
|
||||
|
||||
`shar --text-files {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
`shar {{[-T|--text-files]}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
|
||||
- Include a name and cut mark in the header comment of the archive:
|
||||
|
||||
`shar --archive-name "{{My files}}" --cut-mark {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
`shar {{[-n|--archive-name]}} "{{My files}}" {{[-c|--cut-mark]}} {{path/to/file1 path/to/file2 ...}} > {{path/to/archive.sh}}`
|
||||
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Switch to the other A/B partition:
|
||||
|
||||
`steamos-chroot --partset other`
|
||||
`steamos-chroot {{[-p|--partset]}} other`
|
||||
|
||||
- Switch to a partition on another drive:
|
||||
|
||||
`steamos-chroot --disk {{/dev/sdX}} --partset {{A|B}}`
|
||||
`steamos-chroot {{[-d|--disk]}} {{/dev/sdX}} {{[-p|--partset]}} {{A|B}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`steamos-chroot --help`
|
||||
`steamos-chroot {{[-h|--help]}}`
|
||||
|
||||
30
tldr/linux/wireplumber
Normal file
30
tldr/linux/wireplumber
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# wireplumber
|
||||
|
||||
> A modular session/policy manager for PipeWire and a GObject-based high-level library that wraps PipeWire’s API.
|
||||
> See also: `wpctl`, `pipewire`.
|
||||
> More information: <https://pipewire.pages.freedesktop.org/wireplumber/>.
|
||||
|
||||
- Make WirePlumber start with the user session immediately (for systemd systems):
|
||||
|
||||
`systemctl --user --now enable wireplumber`
|
||||
|
||||
- Run WirePlumber, after `pipewire` is started (for non-systemd systems):
|
||||
|
||||
`wireplumber`
|
||||
|
||||
- Specify a different context configuration file:
|
||||
|
||||
`wireplumber --config-file {{path/to/file}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`wireplumber --help`
|
||||
|
||||
- Display version:
|
||||
|
||||
`wireplumber --version`
|
||||
2
tldr/ls
2
tldr/ls
@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- List all files in [l]ong format (permissions, ownership, size, and modification date):
|
||||
|
||||
`ls {{[-la|--all -l]}}`
|
||||
`ls {{[-la|-l --all]}}`
|
||||
|
||||
- List files in [l]ong format with size displayed using human-readable units (KiB, MiB, GiB):
|
||||
|
||||
|
||||
14
tldr/lzip
14
tldr/lzip
@@ -15,28 +15,28 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Archive a file, keeping the input file:
|
||||
|
||||
`lzip -k {{path/to/file}}`
|
||||
`lzip {{[-k|--keep]}} {{path/to/file}}`
|
||||
|
||||
- Archive a file with the best compression (level=9):
|
||||
|
||||
`lzip -k {{path/to/file}} --best`
|
||||
`lzip {{[-k|--keep]}} {{path/to/file}} --best`
|
||||
|
||||
- Archive a file at the fastest speed (level=0):
|
||||
|
||||
`lzip -k {{path/to/file}} --fast`
|
||||
`lzip {{[-k|--keep]}} {{path/to/file}} --fast`
|
||||
|
||||
- Test the integrity of compressed file:
|
||||
|
||||
`lzip --test {{path/to/archive.lz}}`
|
||||
`lzip {{[-t|--test]}} {{path/to/archive.lz}}`
|
||||
|
||||
- Decompress a file, replacing it with the original uncompressed version:
|
||||
|
||||
`lzip -d {{path/to/archive.lz}}`
|
||||
`lzip {{[-d|--decompress]}} {{path/to/archive.lz}}`
|
||||
|
||||
- Decompress a file, keeping the archive:
|
||||
|
||||
`lzip -d -k {{path/to/archive.lz}}`
|
||||
`lzip {{[-d|--decompress]}} {{[-k|--keep]}} {{path/to/archive.lz}}`
|
||||
|
||||
- List files which are in an archive and show compression stats:
|
||||
|
||||
`lzip --list {{path/to/archive.lz}}`
|
||||
`lzip {{[-l|--list]}} {{path/to/archive.lz}}`
|
||||
|
||||
2
tldr/m4
2
tldr/m4
@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Define a macro before processing files:
|
||||
|
||||
`m4 -D{{macro_name}}={{macro_value}} {{path/to/file}}`
|
||||
`m4 {{[-D|--define]}} {{macro_name}}={{macro_value}} {{path/to/file}}`
|
||||
|
||||
10
tldr/make
10
tldr/make
@@ -19,19 +19,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Call a specific target, executing 4 jobs at a time in parallel:
|
||||
|
||||
`make -j{{4}} {{target}}`
|
||||
`make {{[-j|--jobs]}} {{4}} {{target}}`
|
||||
|
||||
- Use a specific Makefile:
|
||||
|
||||
`make --file {{path/to/file}}`
|
||||
`make {{[-f|--file]}} {{path/to/file}}`
|
||||
|
||||
- Execute make from another directory:
|
||||
|
||||
`make --directory {{path/to/directory}}`
|
||||
`make {{[-C|--directory]}} {{path/to/directory}}`
|
||||
|
||||
- Force making of a target, even if source files are unchanged:
|
||||
|
||||
`make --always-make {{target}}`
|
||||
`make {{[-B|--always-make]}} {{target}}`
|
||||
|
||||
- Override a variable defined in the Makefile:
|
||||
|
||||
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Override variables defined in the Makefile by the environment:
|
||||
|
||||
`make --environment-overrides {{target}}`
|
||||
`make {{[-e|--environment-overrides]}} {{target}}`
|
||||
|
||||
41
tldr/mariadb
Normal file
41
tldr/mariadb
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mariadb
|
||||
|
||||
> The mariadb client tool.
|
||||
> More information: <https://mariadb.com/kb/en/mariadb-command-line-client/>.
|
||||
|
||||
- Connect to a specific MariaDB database:
|
||||
|
||||
`mariadb {{db_name}}`
|
||||
|
||||
- Connect to a specific MariaDB database using username and password:
|
||||
|
||||
`mariadb --user {{user_name}} --password {{your_password}} {{db_name}}`
|
||||
|
||||
- Show warnings after every statement in interactive and batch mode:
|
||||
|
||||
`mariadb --show-warning`
|
||||
|
||||
- Display less verbose outputs (can be used multiple times to produce less output):
|
||||
|
||||
`mariadb {{-s|-ss|-sss|--silent}}`
|
||||
|
||||
- Execute SQL statements from a script file:
|
||||
|
||||
`mariadb {{db_name}} < {{path/to/script.sql}} > {{path/to/output.tab}}`
|
||||
|
||||
- Check memory and open file usage at exit:
|
||||
|
||||
`mariadb --debug-check`
|
||||
|
||||
- Connect using a socket file for local connections:
|
||||
|
||||
`mariadb {{[-S|--socket]}} {{path/to/socket_name}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`mariadb {{[-?|--help]}}`
|
||||
@@ -22,16 +22,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Read a file of MD5 checksums and filenames and verify all files have matching checksums:
|
||||
|
||||
`md5sum --check {{path/to/file.md5}}`
|
||||
`md5sum {{[-c|--check]}} {{path/to/file.md5}}`
|
||||
|
||||
- Only show a message for missing files or when verification fails:
|
||||
|
||||
`md5sum --check --quiet {{path/to/file.md5}}`
|
||||
`md5sum {{[-c|--check]}} --quiet {{path/to/file.md5}}`
|
||||
|
||||
- Only show a message when verification fails, ignoring missing files:
|
||||
|
||||
`md5sum --ignore-missing --check --quiet {{path/to/file.md5}}`
|
||||
`md5sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.md5}}`
|
||||
|
||||
- Check a known MD5 checksum of a file:
|
||||
|
||||
`echo {{known_md5_checksum_of_the_file}} {{path/to/file}} | md5sum --check`
|
||||
`echo {{known_md5_checksum_of_the_file}} {{path/to/file}} | md5sum {{[-c|--check]}}`
|
||||
|
||||
@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Share your terminal session in real-time:
|
||||
|
||||
`mkfifo {{path/to/pipe}}; script -f {{path/to/pipe}}`
|
||||
`mkfifo {{path/to/pipe}}; script {{[-f|--flush]}} {{path/to/pipe}}`
|
||||
|
||||
6
tldr/moe
6
tldr/moe
@@ -14,15 +14,15 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Open a file as read-only:
|
||||
|
||||
`moe --read-only {{path/to/file}}`
|
||||
`moe {{[-o|--read-only]}} {{path/to/file}}`
|
||||
|
||||
- Edit a file without creating backups:
|
||||
|
||||
`moe --no-backup {{path/to/file}}`
|
||||
`moe {{[-B|--no-backup]}} {{path/to/file}}`
|
||||
|
||||
- Edit a file ignoring case in searches:
|
||||
|
||||
`moe --ignore-case {{path/to/file}}`
|
||||
`moe {{[-i|--ignore-case]}} {{path/to/file}}`
|
||||
|
||||
- Save and Quit:
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Convert 1.5K (SI Units) to 1500:
|
||||
|
||||
`numfmt --from=si 1.5K`
|
||||
`numfmt --from si 1.5K`
|
||||
|
||||
- Convert 5th field (1-indexed) to IEC Units without converting header:
|
||||
|
||||
`ls -l | numfmt --header=1 --field=5 --to=iec`
|
||||
`ls -l | numfmt --header=1 --field 5 --to iec`
|
||||
|
||||
- Convert to IEC units, pad with 5 characters, left aligned:
|
||||
|
||||
`du -s * | numfmt --to=iec --format="%-5f"`
|
||||
`du {{[-s|--summarize]}} * | numfmt --to iec --format "%-5f"`
|
||||
|
||||
@@ -10,12 +10,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Generate TOTP token (behaves like Google Authenticator):
|
||||
|
||||
`oathtool --totp --base32 "{{secret}}"`
|
||||
`oathtool --totp {{[-b|--base32]}} "{{secret}}"`
|
||||
|
||||
- Generate a TOTP token for a specific time:
|
||||
|
||||
`oathtool --totp --now "{{2004-02-29 16:21:42}}" --base32 "{{secret}}"`
|
||||
`oathtool --totp {{[-N|--now]}} "{{2004-02-29 16:21:42}}" {{[-b|--base32]}} "{{secret}}"`
|
||||
|
||||
- Validate a TOTP token:
|
||||
|
||||
`oathtool --totp --base32 "{{secret}}" "{{token}}"`
|
||||
`oathtool --totp {{[-b|--base32]}} "{{secret}}" "{{token}}"`
|
||||
|
||||
10
tldr/od
10
tldr/od
@@ -15,20 +15,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display file in verbose mode, i.e. without replacing duplicate lines with `*`:
|
||||
|
||||
`od -v {{path/to/file}}`
|
||||
`od {{[-v|--output-duplicates]}} {{path/to/file}}`
|
||||
|
||||
- Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:
|
||||
|
||||
`od --format={{x}} --address-radix={{d}} -v {{path/to/file}}`
|
||||
`od {{[-t|--format]}} {{x}} {{[-A|--address-radix]}} {{d}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
||||
|
||||
- Display file in hexadecimal format (1-byte units), and 4 bytes per line:
|
||||
|
||||
`od --format={{x1}} --width={{4}} -v {{path/to/file}}`
|
||||
`od {{[-t|--format]}} {{x1}} {{[-w|--width=]}}{{4}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
||||
|
||||
- Display file in hexadecimal format along with its character representation, and do not print byte offsets:
|
||||
|
||||
`od --format={{xz}} --address-radix={{n}} -v {{path/to/file}}`
|
||||
`od {{[-t|--format]}} {{xz}} {{[-A|--address-radix]}} {{n}} {{[-v|--output-duplicates]}} {{path/to/file}}`
|
||||
|
||||
- Read only 100 bytes of a file starting from the 500th byte:
|
||||
|
||||
`od --read-bytes 100 --skip-bytes=500 -v {{path/to/file}}`
|
||||
`od {{[-N|--read-bytes]}} 100 {{[-j|--skip-bytes]}} 500 {{[-v|--output-duplicates]}} {{path/to/file}}`
|
||||
|
||||
21
tldr/openstack-help
Normal file
21
tldr/openstack-help
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# openstack help
|
||||
|
||||
> Display help information about the openstackclient cli.
|
||||
> More information: <https://docs.openstack.org/python-openstackclient/latest/cli/man/openstack.html>.
|
||||
|
||||
- Display a description of a particular command:
|
||||
|
||||
`openstack help {{command_name}}`
|
||||
|
||||
- Get help for Identity v3:
|
||||
|
||||
`openstack --os-identity-api-version 3 --help`
|
||||
|
||||
- Display help:
|
||||
|
||||
`openstack --help`
|
||||
29
tldr/openstack-image
Normal file
29
tldr/openstack-image
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# openstack image
|
||||
|
||||
> OpenStack Image service, aka OpenStack Glance, allows users to upload and discover data assets meant to be used with other services.
|
||||
> More information: <https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/image-v2.html>.
|
||||
|
||||
- List available images:
|
||||
|
||||
`openstack image list {{--private|--shared|--all}}`
|
||||
|
||||
- Display image details:
|
||||
|
||||
`openstack image show --human-readable {{image_id}}`
|
||||
|
||||
- Create/upload an image:
|
||||
|
||||
`openstack image create --file {{path/to/file}} {{--private|--shared|--all}} {{image_name}}`
|
||||
|
||||
- Delete image(s):
|
||||
|
||||
`openstack image delete {{image_id1 image_id2 ...}}`
|
||||
|
||||
- Save an image locally:
|
||||
|
||||
`openstack image save --file {{filename}} {{image_id}}`
|
||||
38
tldr/openstack-server
Normal file
38
tldr/openstack-server
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# openstack server
|
||||
|
||||
> Manage OpenStack virtual machines.
|
||||
> OpenStack Compute service, aka OpenStack Nova, mainly hosts and manages cloud computing systems.
|
||||
> More information: <https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/server.html>.
|
||||
|
||||
- List servers:
|
||||
|
||||
`openstack server list`
|
||||
|
||||
- Start server(s):
|
||||
|
||||
`openstack server start {{instance_id1 instance_id2 ...}}`
|
||||
|
||||
- Stop server:
|
||||
|
||||
`openstack server stop {{instance_id1 instance_id2 ...}}`
|
||||
|
||||
- Create new server:
|
||||
|
||||
`openstack server create --image {{image_id}} --flavor {{flavor_id}} --network {{network_id}} --wait {{server_name}}`
|
||||
|
||||
- Delete server(s):
|
||||
|
||||
`openstack server delete {{instance_id1 instance_id2 ...}}`
|
||||
|
||||
- Migrate server to different host:
|
||||
|
||||
`openstack server migrate --live {{host_hostname}} {{--shared-migration|--block-migration}} --wait {{instance_id}}`
|
||||
|
||||
- Perform a soft or hard reset to the server:
|
||||
|
||||
`openstack server reboot {{--soft|--hard}} --wait {{instance_id}}`
|
||||
34
tldr/openstack-volume
Normal file
34
tldr/openstack-volume
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# openstack volume
|
||||
|
||||
> Manage OpenStack volumes.
|
||||
> OpenStack Block Storage service, aka OpenStack Cinder, provides volumes to Nova vm's, Ironic bare-metal hosts, containers, and others.
|
||||
> More information: <https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/volume.html>.
|
||||
|
||||
- List volumes:
|
||||
|
||||
`openstack volume list --all-projects`
|
||||
|
||||
- Show volume details:
|
||||
|
||||
`openstack volume show {{volume_id}}`
|
||||
|
||||
- Create new volume:
|
||||
|
||||
`openstack volume create --size {{size_in_GB}} --image {{image_id}} --snapshot {{snapshot_id}} {{--bootable|--non-bootable}} {{volume_name}}`
|
||||
|
||||
- Delete volumes(s):
|
||||
|
||||
`openstack volume delete {{volume_id1 volume_id2 ...}}`
|
||||
|
||||
- Migrate volume to a new host:
|
||||
|
||||
`openstack volume migrate --host {{host_hostname}} {{instance_id}}`
|
||||
|
||||
- Set volume properties:
|
||||
|
||||
`openstack volume set --name {{volume_new_name}} --size {{volume_new_size}} {{--attached|--detached}} {{--bootable|--non-bootable}} {{volume_id}}`
|
||||
@@ -10,16 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Output the first few lines of a file:
|
||||
|
||||
`head --lines {{8}} {{path/to/file}}`
|
||||
`head {{[-n|--lines]}} {{8}} {{path/to/file}}`
|
||||
|
||||
- Output the first few bytes of a file:
|
||||
|
||||
`head --bytes {{8}} {{path/to/file}}`
|
||||
`head {{[-c|--bytes]}} {{8}} {{path/to/file}}`
|
||||
|
||||
- Output everything but the last few lines of a file:
|
||||
|
||||
`head --lines -{{8}} {{path/to/file}}`
|
||||
`head {{[-n|--lines]}} -{{8}} {{path/to/file}}`
|
||||
|
||||
- Output everything but the last few bytes of a file:
|
||||
|
||||
`head --bytes -{{8}} {{path/to/file}}`
|
||||
`head {{[-c|--bytes]}} -{{8}} {{path/to/file}}`
|
||||
|
||||
@@ -34,8 +34,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Download 4 files simultaneously from a text file containing links showing progress:
|
||||
|
||||
`parallel -j4 --bar --eta wget -q {} :::: {{path/to/links.txt}}`
|
||||
`parallel -j4 --bar --eta wget {{[-q|--quote]}} {} :::: {{path/to/links.txt}}`
|
||||
|
||||
- Print the jobs which `parallel` is running in `stderr`:
|
||||
|
||||
`parallel -t {{command}} ::: {{args}}`
|
||||
`parallel {{[-t|--verbose]}} {{command}} ::: {{args}}`
|
||||
|
||||
@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Join all the lines into a single line, using TAB as delimiter:
|
||||
|
||||
`paste -s {{path/to/file}}`
|
||||
`paste {{[-s|--serial]}} {{path/to/file}}`
|
||||
|
||||
- Join all the lines into a single line, using the specified delimiter:
|
||||
|
||||
`paste -s -d {{delimiter}} {{path/to/file}}`
|
||||
`paste {{[-s|--serial]}} {{[-d|--delimiters]}} {{delimiter}} {{path/to/file}}`
|
||||
|
||||
- Merge two files side by side, each in its column, using TAB as delimiter:
|
||||
|
||||
@@ -22,9 +22,9 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Merge two files side by side, each in its column, using the specified delimiter:
|
||||
|
||||
`paste -d {{delimiter}} {{path/to/file1}} {{path/to/file2}}`
|
||||
`paste {{[-d|--delimiters]}} {{delimiter}} {{path/to/file1}} {{path/to/file2}}`
|
||||
|
||||
- Merge two files, with lines added alternatively:
|
||||
|
||||
`paste -d '
|
||||
`paste {{[-d|--delimiters]}} '
|
||||
' {{path/to/file1}} {{path/to/file2}}`
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Remove a directory placed on the directory stack via the pushd shell built-in.
|
||||
> See also `pushd` to place a directory on the stack and `dirs` to display directory stack contents.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html>.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html#index-popd>.
|
||||
|
||||
- Remove the top directory from the stack and cd to it:
|
||||
|
||||
|
||||
10
tldr/pr
10
tldr/pr
@@ -14,20 +14,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Print with a custom centered header:
|
||||
|
||||
`pr -h "{{header}}" {{path/to/file1 path/to/file2 ...}}`
|
||||
`pr {{[-h|--header]}} "{{header}}" {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Print with numbered lines and a custom date format:
|
||||
|
||||
`pr -n -D "{{format}}" {{path/to/file1 path/to/file2 ...}}`
|
||||
`pr {{[-n|--number-lines]}} {{[-D|--date-format]}} "{{format}}" {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Print all files together, one in each column, without a header or footer:
|
||||
|
||||
`pr -m -T {{path/to/file1 path/to/file2 ...}}`
|
||||
`pr {{[-m|--merge]}} {{[-T|--omit-pagination]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Print, beginning at page 2 up to page 5, with a given page length (including header and footer):
|
||||
|
||||
`pr +2:5 -l {{page_length}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`pr +2:5 {{[-l|--length]}} {{page_length}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Print with an offset for each line and a truncating custom page width:
|
||||
|
||||
`pr -o {{offset}} -W {{width}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`pr {{[-o|--indent]}} {{offset}} {{[-W|--page_width]}} {{width}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Display the value of a variable and end with NUL instead of newline:
|
||||
|
||||
`printenv --null {{HOME}}`
|
||||
`printenv {{[-0|--null]}} {{HOME}}`
|
||||
|
||||
4
tldr/qcp
4
tldr/qcp
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# qcp
|
||||
|
||||
> Copy files using the default text editor to define the filenames.
|
||||
> More information: <https://www.nongnu.org/renameutils/>.
|
||||
> More information: <https://manned.org/man/qcp>.
|
||||
|
||||
- Copy a single file (open an editor with the source filename on the left and the target filename on the right):
|
||||
|
||||
@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Copy files, but swap the positions of the source and the target filenames in the editor:
|
||||
|
||||
`qcp --option swap {{*.jpg}}`
|
||||
`qcp {{[-o|--option]}} swap {{*.jpg}}`
|
||||
|
||||
10
tldr/qmv
10
tldr/qmv
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# qmv
|
||||
|
||||
> Move files and directories using the default text editor to define the filenames.
|
||||
> More information: <https://www.nongnu.org/renameutils/>.
|
||||
> More information: <https://manned.org/man/qmv>.
|
||||
|
||||
- Move a single file (open an editor with the source filename on the left and the target filename on the right):
|
||||
|
||||
@@ -18,16 +18,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Move multiple directories:
|
||||
|
||||
`qmv -d {{path/to/directory1}} {{path/to/directory2}} {{path/to/directory3}}`
|
||||
`qmv {{[-d|--directory]}} {{path/to/directory1}} {{path/to/directory2}} {{path/to/directory3}}`
|
||||
|
||||
- Move all files and directories inside a directory:
|
||||
|
||||
`qmv --recursive {{path/to/directory}}`
|
||||
`qmv {{[-R|--recursive]}} {{path/to/directory}}`
|
||||
|
||||
- Move files, but swap the positions of the source and the target filenames in the editor:
|
||||
|
||||
`qmv --option swap {{*.jpg}}`
|
||||
`qmv {{[-o|--option]}} swap {{*.jpg}}`
|
||||
|
||||
- Rename all files and folders in the current directory, but show only target filenames in the editor (you can think of it as a kind of simple mode):
|
||||
|
||||
`qmv --format=do .`
|
||||
`qmv {{[-f|--format]}} do .`
|
||||
|
||||
@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Get the absolute path to a file:
|
||||
|
||||
`readlink -f {{path/to/file}}`
|
||||
`readlink {{[-f|--canonicalize]}} {{path/to/file}}`
|
||||
|
||||
@@ -14,16 +14,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Require all path components to exist:
|
||||
|
||||
`realpath --canonicalize-existing {{path/to/file_or_directory}}`
|
||||
`realpath {{[-e|--canonicalize-existing]}} {{path/to/file_or_directory}}`
|
||||
|
||||
- Resolve ".." components before symlinks:
|
||||
|
||||
`realpath --logical {{path/to/file_or_directory}}`
|
||||
`realpath {{[-L|--logical]}} {{path/to/file_or_directory}}`
|
||||
|
||||
- Disable symlink expansion:
|
||||
|
||||
`realpath --no-symlinks {{path/to/file_or_directory}}`
|
||||
`realpath {{[-s|--no-symlinks]}} {{path/to/file_or_directory}}`
|
||||
|
||||
- Suppress error messages:
|
||||
|
||||
`realpath --quiet {{path/to/file_or_directory}}`
|
||||
`realpath {{[-q|--quiet]}} {{path/to/file_or_directory}}`
|
||||
|
||||
@@ -6,16 +6,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# recsel
|
||||
|
||||
> Print records from a recfile: a human-editable, plain text database.
|
||||
> More information: <https://www.gnu.org/software/recutils/manual/recutils.html>.
|
||||
> More information: <https://www.gnu.org/software/recutils/manual/recutils.html#Invoking-recsel>.
|
||||
|
||||
- Extract name and version field:
|
||||
|
||||
`recsel -p name,version {{data.rec}}`
|
||||
`recsel {{[-p|--print]}} name,version {{data.rec}}`
|
||||
|
||||
- Use "~" to match a string with a given regular expression:
|
||||
|
||||
`recsel -e "{{field_name}} ~ '{{regular_expression}}' {{data.rec}}"`
|
||||
`recsel {{[-e|--expression]}} "{{field_name}} ~ '{{regular_expression}}' {{data.rec}}"`
|
||||
|
||||
- Use a predicate to match a name and a version:
|
||||
|
||||
`recsel -e "name ~ '{{regular_expression}}' && version ~ '{{regular_expression}}'" {{data.rec}}`
|
||||
`recsel {{[-e|--expression]}} "name ~ '{{regular_expression}}' && version ~ '{{regular_expression}}'" {{data.rec}}`
|
||||
|
||||
@@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Recursively find patterns in files using regular expressions.
|
||||
> Equivalent to `grep -r`.
|
||||
> More information: <https://www.gnu.org/software/grep/manual/grep.html>.
|
||||
> More information: <https://www.gnu.org/software/grep/manual/grep.html#Command_002dline-Options>.
|
||||
|
||||
- Recursively search for a pattern in the current working directory:
|
||||
|
||||
@@ -15,15 +15,15 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Recursively search for a case-insensitive pattern in the current working directory:
|
||||
|
||||
`rgrep --ignore-case "{{search_pattern}}"`
|
||||
`rgrep {{[-i|--ignore-case]}} "{{search_pattern}}"`
|
||||
|
||||
- Recursively search for an extended regular expression pattern (supports `?`, `+`, `{}`, `()` and `|`) in the current working directory:
|
||||
|
||||
`rgrep --extended-regexp "{{search_pattern}}"`
|
||||
`rgrep {{[-E|--extended-regexp]}} "{{search_pattern}}"`
|
||||
|
||||
- Recursively search for an exact string (disables regular expressions) in the current working directory:
|
||||
|
||||
`rgrep --fixed-strings "{{exact_string}}"`
|
||||
`rgrep {{[-F|--fixed-strings]}} "{{exact_string}}"`
|
||||
|
||||
- Recursively search for a pattern in a specified directory (or file):
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# scheme
|
||||
|
||||
> MIT Scheme language interpreter and REPL (interactive shell).
|
||||
> More information: <https://www.gnu.org/software/mit-scheme>.
|
||||
> More information: <https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-user.html#Command_002dLine-Options>.
|
||||
|
||||
- Start a REPL (interactive shell):
|
||||
|
||||
|
||||
@@ -22,16 +22,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Read a file of SHA1 checksums and filenames and verify all files have matching checksums:
|
||||
|
||||
`sha1sum --check {{path/to/file.sha1}}`
|
||||
`sha1sum {{[-c|--check]}} {{path/to/file.sha1}}`
|
||||
|
||||
- Only show a message for missing files or when verification fails:
|
||||
|
||||
`sha1sum --check --quiet {{path/to/file.sha1}}`
|
||||
`sha1sum {{[-c|--check]}} --quiet {{path/to/file.sha1}}`
|
||||
|
||||
- Only show a message when verification fails, ignoring missing files:
|
||||
|
||||
`sha1sum --ignore-missing --check --quiet {{path/to/file.sha1}}`
|
||||
`sha1sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha1}}`
|
||||
|
||||
- Check a known SHA1 checksum of a file:
|
||||
|
||||
`echo {{known_sha1_checksum_of_the_file}} {{path/to/file}} | sha1sum --check`
|
||||
`echo {{known_sha1_checksum_of_the_file}} {{path/to/file}} | sha1sum {{[-c|--check]}}`
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user