From b6a557f37144dcf248c43cfe96347ea50b00b7c7 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sat, 22 Mar 2025 08:37:12 +0200 Subject: [PATCH] *: remove and merge duplicate pages (#15983) --- pages/common/chsh.md | 17 ----------------- pages/common/coproc.md | 4 ++++ pages/common/cp.md | 16 ++++++++-------- pages/common/duc.md | 10 +++++----- pages/common/ed.md | 2 +- pages/common/flex.md | 26 -------------------------- pages/common/last.md | 20 ++++++++++++++------ pages/common/lex.md | 2 +- pages/common/man.md | 14 +++++++++----- pages/common/mycli.md | 8 ++++---- pages/common/pngcheck.md | 7 ++++--- pages/common/renice.md | 16 ++++++++++------ pages/common/rm.md | 12 ++++++++---- pages/common/rmdir.md | 2 +- pages/common/script.md | 20 ++++++++++++++------ pages/common/tac.md | 12 ++++++------ pages/common/uname.md | 22 +++++++++++++++++----- pages/common/w.md | 17 ++++++++++++----- pages/common/zip.md | 24 ++++++++++++------------ pages/linux/chsh.md | 12 ++++++++---- pages/linux/coproc.md | 32 -------------------------------- pages/linux/cp.md | 36 ------------------------------------ pages/linux/duc.md | 29 ----------------------------- pages/linux/flex.md | 25 +++++++++++++++++++++++++ pages/linux/killall.md | 25 ------------------------- pages/linux/last.md | 37 ------------------------------------- pages/linux/lex.md | 24 +++--------------------- pages/linux/man.md | 36 ------------------------------------ pages/linux/mesg.md | 6 +++--- pages/linux/mktemp.md | 2 +- pages/linux/mycli.md | 16 ---------------- pages/linux/nl.md | 24 ++++++++++++------------ pages/linux/pngcheck.md | 21 --------------------- pages/linux/renice.md | 18 ------------------ pages/linux/rm.md | 29 ----------------------------- pages/linux/rmdir.md | 13 ------------- pages/linux/script.md | 24 ------------------------ pages/linux/tac.md | 25 ------------------------- pages/linux/uname.md | 36 ------------------------------------ pages/linux/w.md | 20 -------------------- pages/linux/zip.md | 33 --------------------------------- pages/osx/ed.md | 25 ------------------------- pages/osx/gnumfmt.md | 2 +- pages/osx/readlink.md | 8 -------- 44 files changed, 183 insertions(+), 626 deletions(-) delete mode 100644 pages/common/chsh.md delete mode 100644 pages/common/flex.md delete mode 100644 pages/linux/coproc.md delete mode 100644 pages/linux/cp.md delete mode 100644 pages/linux/duc.md create mode 100644 pages/linux/flex.md delete mode 100644 pages/linux/killall.md delete mode 100644 pages/linux/last.md delete mode 100644 pages/linux/man.md delete mode 100644 pages/linux/mycli.md delete mode 100644 pages/linux/pngcheck.md delete mode 100644 pages/linux/renice.md delete mode 100644 pages/linux/rm.md delete mode 100644 pages/linux/rmdir.md delete mode 100644 pages/linux/script.md delete mode 100644 pages/linux/tac.md delete mode 100644 pages/linux/uname.md delete mode 100644 pages/linux/w.md delete mode 100644 pages/linux/zip.md delete mode 100644 pages/osx/ed.md delete mode 100644 pages/osx/readlink.md diff --git a/pages/common/chsh.md b/pages/common/chsh.md deleted file mode 100644 index 09b4d329d5..0000000000 --- a/pages/common/chsh.md +++ /dev/null @@ -1,17 +0,0 @@ -# chsh - -> Change user's login shell. -> See platform-specific pages for more options. -> More information: . - -- 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}}` diff --git a/pages/common/coproc.md b/pages/common/coproc.md index 5a0d8910aa..01c4a57fd9 100644 --- a/pages/common/coproc.md +++ b/pages/common/coproc.md @@ -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"` diff --git a/pages/common/cp.md b/pages/common/cp.md index c5e3aa36a2..c2c8f0f832 100644 --- a/pages/common/cp.md +++ b/pages/common/cp.md @@ -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 `): +- 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}}` diff --git a/pages/common/duc.md b/pages/common/duc.md index e41087076a..18e6062071 100644 --- a/pages/common/duc.md +++ b/pages/common/duc.md @@ -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: . -- 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: diff --git a/pages/common/ed.md b/pages/common/ed.md index 2ec44a143d..c60a10283d 100644 --- a/pages/common/ed.md +++ b/pages/common/ed.md @@ -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: diff --git a/pages/common/flex.md b/pages/common/flex.md deleted file mode 100644 index 9f88d83dca..0000000000 --- a/pages/common/flex.md +++ /dev/null @@ -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: . - -- 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}}` diff --git a/pages/common/last.md b/pages/common/last.md index b421ec5a1e..f3a88bc215 100644 --- a/pages/common/last.md +++ b/pages/common/last.md @@ -3,26 +3,34 @@ > View the last logged in users. > More information: . -- 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]}}` diff --git a/pages/common/lex.md b/pages/common/lex.md index 7e0ee7c4c6..d715d01731 100644 --- a/pages/common/lex.md +++ b/pages/common/lex.md @@ -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: . +> More information: . - Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`: diff --git a/pages/common/man.md b/pages/common/man.md index 9f430fed58..7a3a8a68b6 100644 --- a/pages/common/man.md +++ b/pages/common/man.md @@ -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}}"` diff --git a/pages/common/mycli.md b/pages/common/mycli.md index 2b877ac5e3..a126c1ed52 100644 --- a/pages/common/mycli.md +++ b/pages/common/mycli.md @@ -1,7 +1,7 @@ # mycli -> A command-line client for MySQL that can do auto-completion and syntax highlighting. -> More information: . +> A CLI for MySQL, MariaDB, and Percona that can do auto-completion and syntax highlighting. +> More information: . - 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}}` diff --git a/pages/common/pngcheck.md b/pages/common/pngcheck.md index 5dad0710e8..4c57fbbe8e 100644 --- a/pages/common/pngcheck.md +++ b/pages/common/pngcheck.md @@ -1,9 +1,10 @@ # pngcheck -> Print detailed information about and verify PNG, JNG, and MNG files. -> More information: . +> 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: . -- 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}}` diff --git a/pages/common/renice.md b/pages/common/renice.md index e68a8b3673..f3951b9cff 100644 --- a/pages/common/renice.md +++ b/pages/common/renice.md @@ -5,14 +5,18 @@ > See also: `nice`. > More information: . -- 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}}` diff --git a/pages/common/rm.md b/pages/common/rm.md index af2bb25aad..814be25cd7 100644 --- a/pages/common/rm.md +++ b/pages/common/rm.md @@ -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}}` diff --git a/pages/common/rmdir.md b/pages/common/rmdir.md index 62b5127ea7..f6d3ca4743 100644 --- a/pages/common/rmdir.md +++ b/pages/common/rmdir.md @@ -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 ...}}` diff --git a/pages/common/script.md b/pages/common/script.md index 18e0bf6e7b..e88966a2b6 100644 --- a/pages/common/script.md +++ b/pages/common/script.md @@ -1,9 +1,9 @@ # script -> Make a typescript file of a terminal session. +> Record all terminal output to a typescript file. > More information: . -- 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}}` diff --git a/pages/common/tac.md b/pages/common/tac.md index 2f872d8f9d..2fc0c8b5c6 100644 --- a/pages/common/tac.md +++ b/pages/common/tac.md @@ -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 ...}}` diff --git a/pages/common/uname.md b/pages/common/uname.md index 61d6ffa8fe..62a2e571c0 100644 --- a/pages/common/uname.md +++ b/pages/common/uname.md @@ -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` diff --git a/pages/common/w.md b/pages/common/w.md index 0a765c407f..829417ead3 100644 --- a/pages/common/w.md +++ b/pages/common/w.md @@ -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: . -- 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]}}` diff --git a/pages/common/zip.md b/pages/common/zip.md index fc26fd855e..cc93668605 100644 --- a/pages/common/zip.md +++ b/pages/common/zip.md @@ -4,30 +4,30 @@ > See also: `unzip`. > More information: . -- 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}}` diff --git a/pages/linux/chsh.md b/pages/linux/chsh.md index 87c86f1fe8..b2346fa4b4 100644 --- a/pages/linux/chsh.md +++ b/pages/linux/chsh.md @@ -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}}` diff --git a/pages/linux/coproc.md b/pages/linux/coproc.md deleted file mode 100644 index 01c4a57fd9..0000000000 --- a/pages/linux/coproc.md +++ /dev/null @@ -1,32 +0,0 @@ -# coproc - -> Bash builtin for creating interactive asynchronous subshells. -> More information: . - -- 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"` diff --git a/pages/linux/cp.md b/pages/linux/cp.md deleted file mode 100644 index c2c8f0f832..0000000000 --- a/pages/linux/cp.md +++ /dev/null @@ -1,36 +0,0 @@ -# cp - -> Copy files and directories. -> More information: . - -- 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}}` diff --git a/pages/linux/duc.md b/pages/linux/duc.md deleted file mode 100644 index 7da137cb8c..0000000000 --- a/pages/linux/duc.md +++ /dev/null @@ -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: . - -- 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` diff --git a/pages/linux/flex.md b/pages/linux/flex.md new file mode 100644 index 0000000000..dbe4f07ff8 --- /dev/null +++ b/pages/linux/flex.md @@ -0,0 +1,25 @@ +# flex + +> Lexical analyzer generator. +> Given the specification for a lexical analyzer, generates C code implementing it. +> More information: . + +- 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}}` diff --git a/pages/linux/killall.md b/pages/linux/killall.md deleted file mode 100644 index 3573447fec..0000000000 --- a/pages/linux/killall.md +++ /dev/null @@ -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: . - -- 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 ``: - -`killall -INT {{process_name}}` - -- Force kill a process: - -`killall -KILL {{process_name}}` diff --git a/pages/linux/last.md b/pages/linux/last.md deleted file mode 100644 index c6000b467c..0000000000 --- a/pages/linux/last.md +++ /dev/null @@ -1,37 +0,0 @@ -# last - -> List information of last user logins. -> See also: `lastb`, `login`. -> More information: . - -- 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` diff --git a/pages/linux/lex.md b/pages/linux/lex.md index 691cfc6b91..795da5298a 100644 --- a/pages/linux/lex.md +++ b/pages/linux/lex.md @@ -1,25 +1,7 @@ # lex -> Lexical analyzer generator. -> Given the specification for a lexical analyzer, generates C code implementing it. -> More information: . +> 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` diff --git a/pages/linux/man.md b/pages/linux/man.md deleted file mode 100644 index 7a3a8a68b6..0000000000 --- a/pages/linux/man.md +++ /dev/null @@ -1,36 +0,0 @@ -# man - -> Format and display manual pages. -> More information: . - -- 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}}"` diff --git a/pages/linux/mesg.md b/pages/linux/mesg.md index 355cafa167..1e69362a69 100644 --- a/pages/linux/mesg.md +++ b/pages/linux/mesg.md @@ -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: . +> More information: . - 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]}}` diff --git a/pages/linux/mktemp.md b/pages/linux/mktemp.md index b7b4fa9897..f86c1b6094 100644 --- a/pages/linux/mktemp.md +++ b/pages/linux/mktemp.md @@ -25,4 +25,4 @@ - Create an empty temporary directory and print its absolute path: -`mktemp --directory` +`mktemp {{[-d|--directory]}}` diff --git a/pages/linux/mycli.md b/pages/linux/mycli.md deleted file mode 100644 index dc14eac447..0000000000 --- a/pages/linux/mycli.md +++ /dev/null @@ -1,16 +0,0 @@ -# mycli - -> A CLI for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting. -> More information: . - -- 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}}` diff --git a/pages/linux/nl.md b/pages/linux/nl.md index 65f5bc92d6..f3e5db7fc1 100644 --- a/pages/linux/nl.md +++ b/pages/linux/nl.md @@ -1,7 +1,7 @@ # nl > Number lines from a file or from `stdin`. -> More information: . +> More information: . - 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}}` diff --git a/pages/linux/pngcheck.md b/pages/linux/pngcheck.md deleted file mode 100644 index e508d8b436..0000000000 --- a/pages/linux/pngcheck.md +++ /dev/null @@ -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: . - -- 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}}` diff --git a/pages/linux/renice.md b/pages/linux/renice.md deleted file mode 100644 index db52bce367..0000000000 --- a/pages/linux/renice.md +++ /dev/null @@ -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: . - -- 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}}` diff --git a/pages/linux/rm.md b/pages/linux/rm.md deleted file mode 100644 index 814be25cd7..0000000000 --- a/pages/linux/rm.md +++ /dev/null @@ -1,29 +0,0 @@ -# rm - -> Remove files or directories. -> See also: `rmdir`. -> More information: . - -- 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}}` diff --git a/pages/linux/rmdir.md b/pages/linux/rmdir.md deleted file mode 100644 index f6d3ca4743..0000000000 --- a/pages/linux/rmdir.md +++ /dev/null @@ -1,13 +0,0 @@ -# rmdir - -> Remove directories without files. -> See also: `rm`. -> More information: . - -- Remove specific directories: - -`rmdir {{path/to/directory1 path/to/directory2 ...}}` - -- Remove specific nested directories recursively: - -`rmdir {{[-p|--parents]}} {{path/to/directory1 path/to/directory2 ...}}` diff --git a/pages/linux/script.md b/pages/linux/script.md deleted file mode 100644 index bed7e51137..0000000000 --- a/pages/linux/script.md +++ /dev/null @@ -1,24 +0,0 @@ -# script - -> Record all terminal output to file. -> More information: . - -- 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}}` diff --git a/pages/linux/tac.md b/pages/linux/tac.md deleted file mode 100644 index 2f1f317d45..0000000000 --- a/pages/linux/tac.md +++ /dev/null @@ -1,25 +0,0 @@ -# tac - -> Display and concatenate files with lines in reversed order. -> See also: `cat`. -> More information: . - -- 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 ...}}` diff --git a/pages/linux/uname.md b/pages/linux/uname.md deleted file mode 100644 index ce7d289d74..0000000000 --- a/pages/linux/uname.md +++ /dev/null @@ -1,36 +0,0 @@ -# uname - -> Print details about the current machine and the operating system running on it. -> More information: . - -- 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]}}` diff --git a/pages/linux/w.md b/pages/linux/w.md deleted file mode 100644 index e803741708..0000000000 --- a/pages/linux/w.md +++ /dev/null @@ -1,20 +0,0 @@ -# w - -> Display who is logged in and their processes. -> More information: . - -- 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` diff --git a/pages/linux/zip.md b/pages/linux/zip.md deleted file mode 100644 index 8ae57aefaa..0000000000 --- a/pages/linux/zip.md +++ /dev/null @@ -1,33 +0,0 @@ -# zip - -> Package and compress (archive) files into a Zip archive. -> See also: `unzip`. -> More information: . - -- 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}}` diff --git a/pages/osx/ed.md b/pages/osx/ed.md deleted file mode 100644 index b85850abd9..0000000000 --- a/pages/osx/ed.md +++ /dev/null @@ -1,25 +0,0 @@ -# ed - -> The original Unix text editor. -> See also: `awk`, `sed`. -> More information: . - -- 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` diff --git a/pages/osx/gnumfmt.md b/pages/osx/gnumfmt.md index 2e7b72a861..6b5c88b37a 100644 --- a/pages/osx/gnumfmt.md +++ b/pages/osx/gnumfmt.md @@ -4,4 +4,4 @@ - View documentation for the original command: -`tldr -p linux numfmt` +`tldr numfmt` diff --git a/pages/osx/readlink.md b/pages/osx/readlink.md deleted file mode 100644 index 2590f43e48..0000000000 --- a/pages/osx/readlink.md +++ /dev/null @@ -1,8 +0,0 @@ -# readlink - -> Follow symlinks and get symlink information. -> More information: . - -- Print the absolute path which the symlink points to: - -`readlink {{path/to/symlink_file}}`