mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-23 04:15:27 +02:00
*: remove and merge duplicate pages (#15983)
This commit is contained in:
parent
112e4f8dab
commit
b6a557f371
44 changed files with 183 additions and 626 deletions
|
@ -1,17 +0,0 @@
|
|||
# chsh
|
||||
|
||||
> Change user's login shell.
|
||||
> See platform-specific pages for more options.
|
||||
> More information: <https://manned.org/chsh>.
|
||||
|
||||
- Set a specific login shell for the current user interactively:
|
||||
|
||||
`chsh`
|
||||
|
||||
- Set a specific login [s]hell for the current user:
|
||||
|
||||
`chsh -s {{path/to/shell}}`
|
||||
|
||||
- Set a login [s]hell for a specific user:
|
||||
|
||||
`chsh -s {{path/to/shell}} {{username}}`
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
`coproc {{name}} { while read line; do {{command1; command2; ...}}; done }`
|
||||
|
||||
- Create a coprocess which repeatedly reads `stdin`, runs a pipeline on the input, and writes the output to `stdout`:
|
||||
|
||||
`coproc {{name}} { while read line; do echo "$line" | {{command1 | command2 | ...}} | cat /dev/fd/0; done }`
|
||||
|
||||
- Create and use a coprocess running `bc`:
|
||||
|
||||
`coproc BC { bc --mathlib; }; echo "1/3" >&"${BC[1]}"; read output <&"${BC[0]}"; echo "$output"`
|
||||
|
|
|
@ -13,24 +13,24 @@
|
|||
|
||||
- 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 text files to another location, in interactive mode (prompts user before overwriting):
|
||||
- Copy all files with a specific extension to another location, in interactive mode (prompts user before overwriting):
|
||||
|
||||
`cp -i {{*.txt}} {{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 first argument as the destination directory (useful for `xargs ... | cp -t <DEST_DIR>`):
|
||||
- Use the full path of source files, creating any missing intermediate directories when copying:
|
||||
|
||||
`cp -t {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`cp --parents {{source/path/to/file}} {{path/to/target_file}}`
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
> Duc maintains a database of accumulated sizes of directories of the file system, allowing queries in this database, or creating fancy graphs to show where data is.
|
||||
> More information: <http://duc.zevv.nl>.
|
||||
|
||||
- Index the /usr directory, writing to the default database location ~/.duc.db:
|
||||
- Index the `/usr` directory, writing to the default database location `~/.duc.db`:
|
||||
|
||||
`duc index {{/usr}}`
|
||||
|
||||
- List all files and directories under /usr/local, showing relative file sizes in a [g]raph:
|
||||
- List all files and directories under `/usr/local`, showing relative file sizes in a graph:
|
||||
|
||||
`duc ls -Fg {{/usr/local}}`
|
||||
`duc ls {{[-Fg|--classify --graph]}} {{/usr/local}}`
|
||||
|
||||
- List all files and directories under /usr/local using treeview recursively:
|
||||
- List all files and directories under `/usr/local` using treeview recursively:
|
||||
|
||||
`duc ls -Fg -R {{/usr/local}}`
|
||||
`duc ls {{[-Fg|--classify --graph]}} {{[-R|--recursive]}} {{/usr/local}}`
|
||||
|
||||
- Start the graphical interface to explore the file system using sunburst graphs:
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
|
||||
|
||||
`ed {{[-q|--quiet]}}`
|
||||
`ed {{[-q|--quiet]}} {{[-s|--script]}}`
|
||||
|
||||
- Start an interactive editor session without exit status change when command fails:
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# flex
|
||||
|
||||
> Lexical analyzer generator. A rewrite of `lex` with extensions to the POSIX specification.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> Note: long options don't work on OpenBSD.
|
||||
> More information: <https://manned.org/flex>.
|
||||
|
||||
- Generate an analyzer from a flex file, storing it to the file `lex.yy.c`:
|
||||
|
||||
`lex {{analyzer.l}}`
|
||||
|
||||
- Write analyzer to `stdout`:
|
||||
|
||||
`lex -{{-stdout|t}} {{analyzer.l}}`
|
||||
|
||||
- Specify the output file:
|
||||
|
||||
`lex {{analyzer.l}} -o {{analyzer.c}}`
|
||||
|
||||
- Generate a [B]atch scanner instead of an interactive scanner:
|
||||
|
||||
`lex -B {{analyzer.l}}`
|
||||
|
||||
- Compile a C file generated by Lex:
|
||||
|
||||
`cc {{path/to/lex.yy.c}} --output {{executable}}`
|
|
@ -3,26 +3,34 @@
|
|||
> View the last logged in users.
|
||||
> More information: <https://manned.org/last>.
|
||||
|
||||
- View last logins, their duration and other information as read from `/var/log/wtmp`:
|
||||
- View last login infromation (e.g., username, terminal, boot time, kernel) of all users as read from `/var/log/wtmp`:
|
||||
|
||||
`last`
|
||||
|
||||
- List login information of a specific user:
|
||||
|
||||
`last {{username}}`
|
||||
|
||||
- Specify how many of the last logins to show:
|
||||
|
||||
`last -n {{login_count}}`
|
||||
`last {{[-n|--limit]}} {{login_count}}`
|
||||
|
||||
- Print the full date and time for entries and then display the hostname column last to prevent truncation:
|
||||
|
||||
`last -F -a`
|
||||
`last {{[-F|--fulltimes]}} {{[-a|--hostlast]}}`
|
||||
|
||||
- View all logins by a specific user and show the IP address instead of the hostname:
|
||||
|
||||
`last {{username}} -i`
|
||||
`last {{username}} {{[-i|--ip]}}`
|
||||
|
||||
- List information since a specific time and date:
|
||||
|
||||
`last {{[-s|--since]}} {{-7days}}`
|
||||
|
||||
- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
|
||||
|
||||
`last reboot`
|
||||
|
||||
- View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"):
|
||||
- Display help:
|
||||
|
||||
`last shutdown`
|
||||
`last {{[-h|--help]}}`
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> Note: on most major OSes, this command is an alias for `flex`.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
> More information: <https://manned.org/lex>.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
|
||||
|
|
|
@ -7,26 +7,30 @@
|
|||
|
||||
`man {{command}}`
|
||||
|
||||
- Open the man page for a command in a browser (`BROWSER` environment variable can replace `=browser_name`):
|
||||
|
||||
`man {{[-Hbrowser_name|--html=browser_name]}} {{command}}`
|
||||
|
||||
- Display the man page for a command from section 7:
|
||||
|
||||
`man {{7}} {{command}}`
|
||||
|
||||
- List all available sections for a command:
|
||||
|
||||
`man -f {{command}}`
|
||||
`man {{[-f|--whatis]}} {{command}}`
|
||||
|
||||
- Display the path searched for manpages:
|
||||
|
||||
`man --path`
|
||||
`man {{[-w|--path]}}`
|
||||
|
||||
- Display the location of a manpage rather than the manpage itself:
|
||||
|
||||
`man -w {{command}}`
|
||||
`man {{[-w|--where]}} {{command}}`
|
||||
|
||||
- Display the man page using a specific locale:
|
||||
|
||||
`man {{command}} --locale={{locale}}`
|
||||
`man {{[-L|--locale]}} {{locale}} {{command}}`
|
||||
|
||||
- Search for manpages containing a search string:
|
||||
|
||||
`man -k "{{search_string}}"`
|
||||
`man {{[-k|--apropos]}} "{{search_string}}"`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# mycli
|
||||
|
||||
> A command-line client for MySQL that can do auto-completion and syntax highlighting.
|
||||
> More information: <https://mycli.net>.
|
||||
> A CLI for MySQL, MariaDB, and Percona that can do auto-completion and syntax highlighting.
|
||||
> More information: <https://manned.org/mycli>.
|
||||
|
||||
- Connect to a local database on port 3306, using the current user's username:
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
|||
|
||||
- Connect to a database (user will be prompted for a password):
|
||||
|
||||
`mycli -u {{username}} {{database_name}}`
|
||||
`mycli {{[-u|--user]}} {{username}} {{database_name}}`
|
||||
|
||||
- Connect to a database on another host:
|
||||
|
||||
`mycli -h {{database_host}} -P {{port}} -u {{username}} {{database_name}}`
|
||||
`mycli {{[-h|--host]}} {{database_host}} {{[-P|--port]}} {{port}} {{[-u|--user]}} {{username}} {{database_name}}`
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# pngcheck
|
||||
|
||||
> Print detailed information about and verify PNG, JNG, and MNG files.
|
||||
> More information: <http://www.libpng.org/pub/png/apps/pngcheck.html>.
|
||||
> Forensics tool for validating the integrity of PNG based (PNG, JNG, MNG) image files.
|
||||
> Can also extract embedded images and text from a file.
|
||||
> More information: <https://github.com/pnggroup/pngcheck>.
|
||||
|
||||
- Print a summary for an image (width, height, and color depth):
|
||||
- Verify the integrity of an image file (width, height, and color depth):
|
||||
|
||||
`pngcheck {{path/to/image.png}}`
|
||||
|
||||
|
|
|
@ -5,14 +5,18 @@
|
|||
> See also: `nice`.
|
||||
> More information: <https://manned.org/renice>.
|
||||
|
||||
- Increase/decrease the priority of a running [p]rocess:
|
||||
- Set the absolute priority of a running process:
|
||||
|
||||
`renice -n {{3}} -p {{pid}}`
|
||||
`renice --priority {{3}} {{[-p|--pid]}} {{pid}}`
|
||||
|
||||
- Increase/decrease the priority of all processes owned by a [u]ser:
|
||||
- Increase the priority of a running process:
|
||||
|
||||
`renice -n {{-4}} -u {{uid|user}}`
|
||||
`sudo renice --relative {{-4}} {{[-p|--pid]}} {{pid}}`
|
||||
|
||||
- Increase/decrease the priority of all processes that belong to a process [g]roup:
|
||||
- Decrease the priority of all processes owned by a user:
|
||||
|
||||
`renice -n {{5}} -g {{process_group}}`
|
||||
`renice --relative {{4}} {{[-u|--user]}} {{uid|user}}`
|
||||
|
||||
- Set the priority of all processes that belong to a process group:
|
||||
|
||||
`sudo renice {{-5}} {{[-g|--pgrp]}} {{process_group}}`
|
||||
|
|
|
@ -10,16 +10,20 @@
|
|||
|
||||
- Remove specific files ignoring nonexistent ones:
|
||||
|
||||
`rm -f {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-f|--force]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files interactively prompting before each removal:
|
||||
|
||||
`rm -i {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-i|--interactive]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files printing info about each removal:
|
||||
|
||||
`rm -v {{path/to/file1 path/to/file2 ...}}`
|
||||
`rm {{[-v|--verbose]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files and directories recursively:
|
||||
|
||||
`rm -r {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
`rm {{[-r|--recursive]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Remove empty directories (this is considered the safe method):
|
||||
|
||||
`rm {{[-d|--dir]}} {{path/to/directory}}`
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
- Remove specific nested directories recursively:
|
||||
|
||||
`rmdir -p {{path/to/directory1 path/to/directory2 ...}}`
|
||||
`rmdir {{[-p|--parents]}} {{path/to/directory1 path/to/directory2 ...}}`
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# script
|
||||
|
||||
> Make a typescript file of a terminal session.
|
||||
> Record all terminal output to a typescript file.
|
||||
> More information: <https://manned.org/script>.
|
||||
|
||||
- Start recording in file named "typescript":
|
||||
- Record a new session to a file named `typescript` in the current directory:
|
||||
|
||||
`script`
|
||||
|
||||
|
@ -11,14 +11,22 @@
|
|||
|
||||
`exit`
|
||||
|
||||
- Start recording in a given file:
|
||||
- Record a new session to a custom filepath:
|
||||
|
||||
`script {{logfile.log}}`
|
||||
`script {{path/to/session.out}}`
|
||||
|
||||
- Append to an existing file:
|
||||
|
||||
`script -a {{logfile.log}}`
|
||||
`script {{[-a|--append]}} {{logfile.log}}`
|
||||
|
||||
- Record timing information (data is outputted to `stderr`):
|
||||
|
||||
`script {{[-t|--timing]}} 2> {{path/to/timing_file}}`
|
||||
|
||||
- Write out data as soon as it happens:
|
||||
|
||||
`script {{[-f|--flush]}} {{path/to/file}}`
|
||||
|
||||
- Execute quietly without start and done messages:
|
||||
|
||||
`script -q {{logfile.log}}`
|
||||
`script {{[-q|--quiet]}} {{logfile.log}}`
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
`{{cat path/to/file}} | tac`
|
||||
|
||||
- Use a specific [s]eparator:
|
||||
- Use a specific separator:
|
||||
|
||||
`tac -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a specific [r]egex as a [s]eparator:
|
||||
- Use a specific regex as a separator:
|
||||
|
||||
`tac -r -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-r|--regex]}} {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a separator [b]efore each file:
|
||||
- Use a separator before each file:
|
||||
|
||||
`tac -b {{path/to/file1 path/to/file2 ...}}`
|
||||
`tac {{[-b|--before]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
|
|
@ -8,18 +8,30 @@
|
|||
|
||||
`uname`
|
||||
|
||||
- Print all available system information:
|
||||
|
||||
`uname {{[-a|--all]}}`
|
||||
|
||||
- Print system architecture and processor information:
|
||||
|
||||
`uname --machine --processor`
|
||||
`uname {{[-mp|--machine --processsor]}}`
|
||||
|
||||
- Print kernel name, kernel release and kernel version:
|
||||
|
||||
`uname --kernel-name --kernel-release --kernel-version`
|
||||
`uname {{[-srv|--kernel-name --kernel-release --kernel-version]}}`
|
||||
|
||||
- Print system hostname:
|
||||
|
||||
`uname --nodename`
|
||||
`uname {{[-n|--nodename]}}`
|
||||
|
||||
- Print all available system information:
|
||||
- Print the current operating system name:
|
||||
|
||||
`uname --all`
|
||||
`uname {{[-o|--operating-system]}}`
|
||||
|
||||
- Print the current network node host name:
|
||||
|
||||
`uname {{[-n|--nodename]}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`uname --help`
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
# w
|
||||
|
||||
> Show who is logged on and what they are doing.
|
||||
> Print user login, TTY, remote host, login time, idle time, current process.
|
||||
> Display who is logged in and their processes.
|
||||
> More information: <https://manned.org/w>.
|
||||
|
||||
- Show logged-in users info:
|
||||
- Display information about all users who are currently logged in:
|
||||
|
||||
`w`
|
||||
|
||||
- Show logged-in users info without a header:
|
||||
- Display information about a specific user:
|
||||
|
||||
`w -h`
|
||||
`w {{username}}`
|
||||
|
||||
- Display logged-in user information without a header:
|
||||
|
||||
`w {{[-h|--no-header]}}`
|
||||
|
||||
- Display information without including the login, JCPU and PCPU columns:
|
||||
|
||||
`w {{[-s|--short]}}`
|
||||
|
|
|
@ -4,30 +4,30 @@
|
|||
> See also: `unzip`.
|
||||
> More information: <https://manned.org/zip>.
|
||||
|
||||
- Add files/directories to a specific archive ([r]ecursively):
|
||||
- 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 ([d]elete):
|
||||
- Remove files/directories from a specific archive:
|
||||
|
||||
`zip -d {{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 -r {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} -x {{path/to/excluded_files_or_directories}}`
|
||||
`zip {{[-r|--recurse-paths]}} {{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 [e]ncrypted archive with a specific password:
|
||||
- Create an encrypted archive with a specific password:
|
||||
|
||||
`zip -r -e {{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):
|
||||
- Archive files/directories to a multi-part split 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}}`
|
||||
|
|
|
@ -8,10 +8,14 @@
|
|||
|
||||
`chsh`
|
||||
|
||||
- Set a specific login [s]hell for the current user:
|
||||
- List available shells:
|
||||
|
||||
`chsh --shell {{path/to/shell}}`
|
||||
`chsl {{[-l|--list-shells]}}`
|
||||
|
||||
- Set a login [s]hell for a specific user:
|
||||
- Set a specific login shell for the current user:
|
||||
|
||||
`sudo chsh --shell {{path/to/shell}} {{username}}`
|
||||
`chsh {{[-s|--shell]}} {{path/to/shell}}`
|
||||
|
||||
- Set a login shell for a specific user:
|
||||
|
||||
`sudo chsh {{[-s|--shell]}} {{path/to/shell}} {{username}}`
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
# coproc
|
||||
|
||||
> Bash builtin for creating interactive asynchronous subshells.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Coprocesses>.
|
||||
|
||||
- Run a subshell asynchronously:
|
||||
|
||||
`coproc { {{command1; command2; ...}}; }`
|
||||
|
||||
- Create a coprocess with a specific name:
|
||||
|
||||
`coproc {{name}} { {{command1; command2; ...}}; }`
|
||||
|
||||
- Write to a specific coprocess `stdin`:
|
||||
|
||||
`echo "{{input}}" >&"${{{name}}[1]}"`
|
||||
|
||||
- Read from a specific coprocess `stdout`:
|
||||
|
||||
`read {{variable}} <&"${{{name}}[0]}"`
|
||||
|
||||
- Create a coprocess which repeatedly reads `stdin` and runs some commands on the input:
|
||||
|
||||
`coproc {{name}} { while read line; do {{command1; command2; ...}}; done }`
|
||||
|
||||
- Create a coprocess which repeatedly reads `stdin`, runs a pipeline on the input, and writes the output to `stdout`:
|
||||
|
||||
`coproc {{name}} { while read line; do echo "$line" | {{command1 | command2 | ...}} | cat /dev/fd/0; done }`
|
||||
|
||||
- Create and use a coprocess running `bc`:
|
||||
|
||||
`coproc BC { bc --mathlib; }; echo "1/3" >&"${BC[1]}"; read output <&"${BC[0]}"; echo "$output"`
|
|
@ -1,36 +0,0 @@
|
|||
# cp
|
||||
|
||||
> Copy files and directories.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html>.
|
||||
|
||||
- Copy a file to another location:
|
||||
|
||||
`cp {{path/to/source_file.ext}} {{path/to/target_file.ext}}`
|
||||
|
||||
- Copy a file into another directory, keeping the filename:
|
||||
|
||||
`cp {{path/to/source_file.ext}} {{path/to/target_parent_directory}}`
|
||||
|
||||
- Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it):
|
||||
|
||||
`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|--verbose --recursive]}} {{path/to/source_directory}} {{path/to/target_directory}}`
|
||||
|
||||
- Copy multiple files at once to a directory:
|
||||
|
||||
`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|--interactive]}} {{*.ext}} {{path/to/target_directory}}`
|
||||
|
||||
- Follow symbolic links before copying:
|
||||
|
||||
`cp {{[-L|--dereference]}} {{link}} {{path/to/target_directory}}`
|
||||
|
||||
- Use the full path of source files, creating any missing intermediate directories when copying:
|
||||
|
||||
`cp --parents {{source/path/to/file}} {{path/to/target_file}}`
|
|
@ -1,29 +0,0 @@
|
|||
# duc
|
||||
|
||||
> A collection of tools for indexing, inspecting and visualizing disk usage.
|
||||
> Duc maintains a database of accumulated sizes of directories in the file system, allowing to query this database, or creating fancy graphs to show where data is.
|
||||
> More information: <http://duc.zevv.nl>.
|
||||
|
||||
- Index the `/usr` directory, writing to the default database location `~/.duc.db`:
|
||||
|
||||
`duc index {{/usr}}`
|
||||
|
||||
- List all files and directories under `/usr/local`, showing relative file sizes in a [g]raph:
|
||||
|
||||
`duc ls --classify --graph {{/usr/local}}`
|
||||
|
||||
- List all files and directories under `/usr/local` using treeview recursively:
|
||||
|
||||
`duc ls --classify --graph --recursive {{/usr/local}}`
|
||||
|
||||
- Start the graphical interface to explore the file system using sunburst graphs:
|
||||
|
||||
`duc gui {{/usr}}`
|
||||
|
||||
- Run the ncurses console interface to explore the file system:
|
||||
|
||||
`duc ui {{/usr}}`
|
||||
|
||||
- Dump database info:
|
||||
|
||||
`duc info`
|
25
pages/linux/flex.md
Normal file
25
pages/linux/flex.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# flex
|
||||
|
||||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
|
||||
`flex {{analyzer.l}}`
|
||||
|
||||
- Write analyzer to `stdout`:
|
||||
|
||||
`flex {{[-t|--stdout]}} {{analyzer.l}}`
|
||||
|
||||
- Specify the output file:
|
||||
|
||||
`flex {{analyzer.l}} {{[-o|--outfile]}} {{analyzer.c}}`
|
||||
|
||||
- Generate a batch scanner instead of an interactive scanner:
|
||||
|
||||
`flex {{[-B|--batch]}} {{analyzer.l}}`
|
||||
|
||||
- Compile a C file generated by Lex:
|
||||
|
||||
`cc {{path/to/lex.yy.c}} -o {{executable}}`
|
|
@ -1,25 +0,0 @@
|
|||
# killall
|
||||
|
||||
> Send kill signal to all instances of a process by name (must be exact name).
|
||||
> All signals except SIGKILL and SIGSTOP can be intercepted by the process, allowing a clean exit.
|
||||
> More information: <https://manned.org/killall>.
|
||||
|
||||
- Terminate a process using the default SIGTERM (terminate) signal:
|
||||
|
||||
`killall {{process_name}}`
|
||||
|
||||
- List available signal names (to be used without the 'SIG' prefix):
|
||||
|
||||
`killall --list`
|
||||
|
||||
- Interactively ask for confirmation before termination:
|
||||
|
||||
`killall -i {{process_name}}`
|
||||
|
||||
- Terminate a process using the SIGINT (interrupt) signal, which is the same signal sent by pressing `<Ctrl c>`:
|
||||
|
||||
`killall -INT {{process_name}}`
|
||||
|
||||
- Force kill a process:
|
||||
|
||||
`killall -KILL {{process_name}}`
|
|
@ -1,37 +0,0 @@
|
|||
# last
|
||||
|
||||
> List information of last user logins.
|
||||
> See also: `lastb`, `login`.
|
||||
> More information: <https://manned.org/last.1>.
|
||||
|
||||
- List login information (e.g., username, terminal, boot time, kernel) of all users:
|
||||
|
||||
`last`
|
||||
|
||||
- List login information of a specific user:
|
||||
|
||||
`last {{username}}`
|
||||
|
||||
- List information of a specific TTY:
|
||||
|
||||
`last {{tty1}}`
|
||||
|
||||
- List most recent information (by default, the newest are at the top):
|
||||
|
||||
`last | tac`
|
||||
|
||||
- List information of system boots:
|
||||
|
||||
`last "{{system boot}}"`
|
||||
|
||||
- List information with a specific [t]imestamp format:
|
||||
|
||||
`last --time-format {{notime|full|iso}}`
|
||||
|
||||
- List information [s]ince a specific time and date:
|
||||
|
||||
`last --since {{-7days}}`
|
||||
|
||||
- List information (i.e., hostname and IP) of remote hosts:
|
||||
|
||||
`last --dns`
|
|
@ -1,25 +1,7 @@
|
|||
# lex
|
||||
|
||||
> Lexical analyzer generator.
|
||||
> Given the specification for a lexical analyzer, generates C code implementing it.
|
||||
> More information: <https://manned.org/lex.1>.
|
||||
> This command is an alias of `flex`.
|
||||
|
||||
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
|
||||
- View documentation for the original command:
|
||||
|
||||
`lex {{analyzer.l}}`
|
||||
|
||||
- Write analyzer to `stdout`:
|
||||
|
||||
`lex -{{-stdout|t}} {{analyzer.l}}`
|
||||
|
||||
- Specify the output file:
|
||||
|
||||
`lex {{analyzer.l}} --outfile {{analyzer.c}}`
|
||||
|
||||
- Generate a [B]atch scanner instead of an interactive scanner:
|
||||
|
||||
`lex -B {{analyzer.l}}`
|
||||
|
||||
- Compile a C file generated by Lex:
|
||||
|
||||
`cc {{path/to/lex.yy.c}} --output {{executable}}`
|
||||
`tldr flex`
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
# man
|
||||
|
||||
> Format and display manual pages.
|
||||
> More information: <https://manned.org/man>.
|
||||
|
||||
- Display the man page for a command:
|
||||
|
||||
`man {{command}}`
|
||||
|
||||
- Open the man page for a command in a browser (`BROWSER` environment variable can replace `=browser_name`):
|
||||
|
||||
`man {{[-Hbrowser_name|--html=browser_name]}} {{command}}`
|
||||
|
||||
- Display the man page for a command from section 7:
|
||||
|
||||
`man {{7}} {{command}}`
|
||||
|
||||
- List all available sections for a command:
|
||||
|
||||
`man {{[-f|--whatis]}} {{command}}`
|
||||
|
||||
- Display the path searched for manpages:
|
||||
|
||||
`man {{[-w|--path]}}`
|
||||
|
||||
- Display the location of a manpage rather than the manpage itself:
|
||||
|
||||
`man {{[-w|--where]}} {{command}}`
|
||||
|
||||
- Display the man page using a specific locale:
|
||||
|
||||
`man {{[-L|--locale]}} {{locale}} {{command}}`
|
||||
|
||||
- Search for manpages containing a search string:
|
||||
|
||||
`man {{[-k|--apropos]}} "{{search_string}}"`
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
> Check or set a terminal's ability to receive messages from other users, usually from the `write` command.
|
||||
> See also `write`, `talk`.
|
||||
> More information: <https://manned.org/mesg.1>.
|
||||
> More information: <https://manned.org/mesg>.
|
||||
|
||||
- Check terminal's openness to write messages:
|
||||
|
||||
|
@ -16,6 +16,6 @@
|
|||
|
||||
`mesg y`
|
||||
|
||||
- Enable [v]erbose mode, printing a warning if the command is not executed from a terminal:
|
||||
- Enable verbose mode, printing a warning if the command is not executed from a terminal:
|
||||
|
||||
`mesg --verbose`
|
||||
`mesg {{[-v|--verbose]}}`
|
||||
|
|
|
@ -25,4 +25,4 @@
|
|||
|
||||
- Create an empty temporary directory and print its absolute path:
|
||||
|
||||
`mktemp --directory`
|
||||
`mktemp {{[-d|--directory]}}`
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# mycli
|
||||
|
||||
> A CLI for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting.
|
||||
> More information: <https://manned.org/mycli>.
|
||||
|
||||
- Connect to a database with the currently logged in user:
|
||||
|
||||
`mycli {{database_name}}`
|
||||
|
||||
- Connect to a database with the specified user:
|
||||
|
||||
`mycli -u {{user}} {{database_name}}`
|
||||
|
||||
- Connect to a database on the specified host with the specified user:
|
||||
|
||||
`mycli -u {{user}} -h {{host}} {{database_name}}`
|
|
@ -1,7 +1,7 @@
|
|||
# nl
|
||||
|
||||
> Number lines from a file or from `stdin`.
|
||||
> More information: <https://manned.org/nl.1p>.
|
||||
> More information: <https://manned.org/man/nl>.
|
||||
|
||||
- Number non-blank lines in a file:
|
||||
|
||||
|
@ -11,26 +11,26 @@
|
|||
|
||||
`{{command}} | nl -`
|
||||
|
||||
- Number [a]ll [b]ody lines including blank lines or do [n]ot number [b]ody lines:
|
||||
- Number [a]ll body lines including blank lines or do [n]ot number body lines:
|
||||
|
||||
`nl --body-numbering {{a|n}} {{path/to/file}}`
|
||||
`nl {{[-b|--body-numbering]}} {{a|n}} {{path/to/file}}`
|
||||
|
||||
- Number only the [b]ody lines that match a basic regular expression (BRE) [p]attern:
|
||||
- Number only the body lines that match a basic regular expression (BRE) [p]attern:
|
||||
|
||||
`nl --body-numbering p'FooBar[0-9]' {{path/to/file}}`
|
||||
`nl {{[-b|--body-numbering]}} p'FooBar[0-9]' {{path/to/file}}`
|
||||
|
||||
- Use a specific [i]ncrement for line numbering:
|
||||
- Use a specific increment for line numbering:
|
||||
|
||||
`nl --line-increment {{increment}} {{path/to/file}}`
|
||||
`nl {{[-i|--line-increment]}} {{increment}} {{path/to/file}}`
|
||||
|
||||
- Specify the line numbering format to [r]ight or [l]eft justified, keeping leading [z]eros or [n]ot:
|
||||
|
||||
`nl --number-format {{rz|ln|rn}}`
|
||||
`nl {{[-n|--number-format]}} {{rz|ln|rn}}`
|
||||
|
||||
- Specify the line numbering's [w]idth (6 by default):
|
||||
- Specify the line numbering's width (6 by default):
|
||||
|
||||
`nl --number-width {{col_width}} {{path/to/file}}`
|
||||
`nl {{[-w|--number-width]}} {{col_width}} {{path/to/file}}`
|
||||
|
||||
- Use a specific string to [s]eparate the line numbers from the lines (TAB by default):
|
||||
- Use a specific string to separate the line numbers from the lines (TAB by default):
|
||||
|
||||
`nl --number-separator {{separator}} {{path/to/file}}`
|
||||
`nl {{[-s|--number-separator]}} {{separator}} {{path/to/file}}`
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# pngcheck
|
||||
|
||||
> Forensics tool for validating the integrity of PNG based (PNG, JNG, MNG) image files.
|
||||
> Can also extract embedded images and text from a file.
|
||||
> More information: <http://www.libpng.org/pub/png/apps/pngcheck.html>.
|
||||
|
||||
- Verify the integrity of an image file:
|
||||
|
||||
`pngcheck {{path/to/file.png}}`
|
||||
|
||||
- Check the file with [v]erbose and [c]olorized output:
|
||||
|
||||
`pngcheck -vc {{path/to/file.png}}`
|
||||
|
||||
- Display contents of [t]ext chunks and [s]earch for PNGs within a specific file:
|
||||
|
||||
`pngcheck -ts {{path/to/file.png}}`
|
||||
|
||||
- Search for, and e[x]tract embedded PNGs within a specific file:
|
||||
|
||||
`pngcheck -x {{path/to/file.png}}`
|
|
@ -1,18 +0,0 @@
|
|||
# renice
|
||||
|
||||
> Alter the scheduling priority/niceness of running processes.
|
||||
> Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).
|
||||
> See also: `nice`.
|
||||
> More information: <https://manned.org/renice>.
|
||||
|
||||
- Set the absolute priority of a running [p]rocess:
|
||||
|
||||
`renice {{+3}} -p {{pid}}`
|
||||
|
||||
- Increase/decrease the priority of all processes owned by a [u]ser:
|
||||
|
||||
`renice --relative {{-4}} -u {{uid|user}}`
|
||||
|
||||
- Set the priority of all processes that belong to a process [g]roup:
|
||||
|
||||
`renice --absolute {{5}} -g {{process_group}}`
|
|
@ -1,29 +0,0 @@
|
|||
# rm
|
||||
|
||||
> Remove files or directories.
|
||||
> See also: `rmdir`.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/rm-invocation.html>.
|
||||
|
||||
- Remove specific files:
|
||||
|
||||
`rm {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files ignoring nonexistent ones:
|
||||
|
||||
`rm {{[-f|--force]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files interactively prompting before each removal:
|
||||
|
||||
`rm {{[-i|--interactive]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files printing info about each removal:
|
||||
|
||||
`rm {{[-v|--verbose]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Remove specific files and directories recursively:
|
||||
|
||||
`rm {{[-r|--recursive]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Remove empty directories (this is considered the safe method):
|
||||
|
||||
`rm {{[-d|--dir]}} {{path/to/directory}}`
|
|
@ -1,13 +0,0 @@
|
|||
# rmdir
|
||||
|
||||
> Remove directories without files.
|
||||
> See also: `rm`.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/rmdir-invocation.html>.
|
||||
|
||||
- Remove specific directories:
|
||||
|
||||
`rmdir {{path/to/directory1 path/to/directory2 ...}}`
|
||||
|
||||
- Remove specific nested directories recursively:
|
||||
|
||||
`rmdir {{[-p|--parents]}} {{path/to/directory1 path/to/directory2 ...}}`
|
|
@ -1,24 +0,0 @@
|
|||
# script
|
||||
|
||||
> Record all terminal output to file.
|
||||
> More information: <https://manned.org/script>.
|
||||
|
||||
- Record a new session to a file named `typescript` in the current directory:
|
||||
|
||||
`script`
|
||||
|
||||
- Record a new session to a custom filepath:
|
||||
|
||||
`script {{path/to/session.out}}`
|
||||
|
||||
- Record a new session, appending to an existing file:
|
||||
|
||||
`script -a {{path/to/session.out}}`
|
||||
|
||||
- Record timing information (data is outputted to `stderr`):
|
||||
|
||||
`script -t 2> {{path/to/timing_file}}`
|
||||
|
||||
- Write out data as soon as it happens:
|
||||
|
||||
`script -f {{path/to/file}}`
|
|
@ -1,25 +0,0 @@
|
|||
# tac
|
||||
|
||||
> Display and concatenate files with lines in reversed order.
|
||||
> See also: `cat`.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/tac-invocation.html>.
|
||||
|
||||
- Concatenate specific files in reversed order:
|
||||
|
||||
`tac {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Display `stdin` in reversed order:
|
||||
|
||||
`{{cat path/to/file}} | tac`
|
||||
|
||||
- Use a specific separator:
|
||||
|
||||
`tac --separator {{,}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a specific regex as a separator:
|
||||
|
||||
`tac --regex --separator {{[,;]}} {{path/to/file1 path/to/file2 ...}}`
|
||||
|
||||
- Use a separator before each file:
|
||||
|
||||
`tac --before {{path/to/file1 path/to/file2 ...}}`
|
|
@ -1,36 +0,0 @@
|
|||
# uname
|
||||
|
||||
> Print details about the current machine and the operating system running on it.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/uname-invocation.html>.
|
||||
|
||||
- Print all information:
|
||||
|
||||
`uname {{[-a|--all]}}`
|
||||
|
||||
- Print the current kernel name:
|
||||
|
||||
`uname {{[-s|--kernel-name]}}`
|
||||
|
||||
- Print the current network node host name:
|
||||
|
||||
`uname {{[-n|--nodename]}}`
|
||||
|
||||
- Print the current kernel release:
|
||||
|
||||
`uname {{[-r|--kernel-release]}}`
|
||||
|
||||
- Print the current kernel version:
|
||||
|
||||
`uname {{[-v|--kernel-version]}}`
|
||||
|
||||
- Print the current machine hardware name:
|
||||
|
||||
`uname {{[-m|--machine]}}`
|
||||
|
||||
- Print the current processor type:
|
||||
|
||||
`uname {{[-p|--processsor]}}`
|
||||
|
||||
- Print the current operating system name:
|
||||
|
||||
`uname {{[-o|--operating-system]}}`
|
|
@ -1,20 +0,0 @@
|
|||
# w
|
||||
|
||||
> Display who is logged in and their processes.
|
||||
> More information: <https://www.geeksforgeeks.org/w-command-in-linux-with-examples/>.
|
||||
|
||||
- Display information about all users who are currently logged in:
|
||||
|
||||
`w`
|
||||
|
||||
- Display information about a specific user:
|
||||
|
||||
`w {{username}}`
|
||||
|
||||
- Display information without including the header:
|
||||
|
||||
`w --no-header`
|
||||
|
||||
- Display information without including the login, JCPU and PCPU columns:
|
||||
|
||||
`w --short`
|
|
@ -1,33 +0,0 @@
|
|||
# zip
|
||||
|
||||
> Package and compress (archive) files into a Zip archive.
|
||||
> See also: `unzip`.
|
||||
> More information: <https://manned.org/zip>.
|
||||
|
||||
- Add files/directories to a specific archive:
|
||||
|
||||
`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 {{[-d|--delete]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Archive files/directories excluding specified ones:
|
||||
|
||||
`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|--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|--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 split Zip archive (e.g. 3 GB parts):
|
||||
|
||||
`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|--split-size --freshen]}} {{path/to/compressed.zip}}`
|
|
@ -1,25 +0,0 @@
|
|||
# ed
|
||||
|
||||
> The original Unix text editor.
|
||||
> See also: `awk`, `sed`.
|
||||
> More information: <https://www.gnu.org/software/ed/manual/ed_manual.html>.
|
||||
|
||||
- Start an interactive editor session with an empty document:
|
||||
|
||||
`ed`
|
||||
|
||||
- Start an interactive editor session with an empty document and a specific [p]rompt:
|
||||
|
||||
`ed -p '> '`
|
||||
|
||||
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt:
|
||||
|
||||
`ed -s`
|
||||
|
||||
- Edit a specific file (this shows the byte count of the loaded file):
|
||||
|
||||
`ed {{path/to/file}}`
|
||||
|
||||
- Replace a string with a specific replacement for all lines:
|
||||
|
||||
`,s/{{regular_expression}}/{{replacement}}/g`
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr -p linux numfmt`
|
||||
`tldr numfmt`
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# readlink
|
||||
|
||||
> Follow symlinks and get symlink information.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/readlink-invocation.html>.
|
||||
|
||||
- Print the absolute path which the symlink points to:
|
||||
|
||||
`readlink {{path/to/symlink_file}}`
|
Loading…
Add table
Reference in a new issue