1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-10 15:33:50 +02:00

pages/common/*: correct urls, see also improvements, unbashify pages, examples addition (#16841)

Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
This commit is contained in:
Pranaov S 2025-06-14 16:02:15 +00:00 committed by GitHub
parent 6b116b1ef3
commit 8bc9dce9b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 43 additions and 15 deletions

View file

@ -1,8 +1,9 @@
# alias # alias
> Create aliases - words that are replaced by a command string. > Create aliases - words that are replaced by a command string.
> Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. `~/.bashrc`. > Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. `~/.bashrc` for Bash or `~/.zshrc` for Zsh.
> More information: <https://tldp.org/LDP/abs/html/aliases.html>. > See also: `unalias`.
> More information: <https://manned.org/alias>.
- List all aliases: - List all aliases:

View file

@ -1,12 +1,13 @@
# bg # bg
> Resume suspended jobs (e.g. using `<Ctrl z>`), and keeps them running in the background. > Resume suspended jobs (e.g. using `<Ctrl z>`), and keeps them running in the background.
> See also: `jobs`, `fg` and `disown`.
> More information: <https://manned.org/bg>. > More information: <https://manned.org/bg>.
- Resume the most recently suspended job and run it in the background: - Resume the most recently suspended job and run it in the background:
`bg` `bg`
- Resume a specific job (use `jobs -l` to get its ID) and run it in the background: - Resume a specific job and run it in the background (run `jobs` to find the job number):
`bg %{{job_id}}` `bg %{{job_number}}`

View file

@ -7,6 +7,10 @@
`command {{ls}}` `command {{ls}}`
- Find and execute a command using a default `$PATH` (`/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc`) that guarantees to find all standard utilities:
`command -p {{command_name}}`
- Display the path to the executable or the alias definition of a specific command: - Display the path to the executable or the alias definition of a specific command:
`command -v {{command_name}}` `command -v {{command_name}}`

View file

@ -2,6 +2,7 @@
> Display or manipulate the directory stack. > Display or manipulate the directory stack.
> The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands. > The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands.
> See also: `pushd`, `popd`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Directory-Stack-Builtins>. > More information: <https://www.gnu.org/software/bash/manual/bash.html#Directory-Stack-Builtins>.
- Display the directory stack with a space between each entry: - Display the directory stack with a space between each entry:
@ -12,10 +13,22 @@
`dirs -p` `dirs -p`
- Display only the `n`th entry in the directory stack, starting at 0: - Display a numbered list of entries in the directory stack:
`dirs -v`
- Display the directory stack without the tilde-prefix (`~`):
`dirs -l`
- Display only the `n`th entry in the directory stack, starting at 0 (Bash only):
`dirs +{{n}}` `dirs +{{n}}`
- Display only the `n`th entry in the directory stack from the last, starting at 0 (Bash only):
`dirs -{{n}}`
- Clear the directory stack: - Clear the directory stack:
`dirs -c` `dirs -c`

View file

@ -1,21 +1,21 @@
# disown # disown
> Allow sub-processes to live beyond the shell that they are attached to. > Allow sub-processes to live beyond the shell that they are attached to.
> See also the `jobs` command. > See also: `jobs` for finding job numbers.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-disown>. > More information: <https://www.gnu.org/software/bash/manual/bash.html#index-disown>.
- Disown the current job: - Disown the current job:
`disown` `disown`
- Disown a specific job: - Disown a specific job (run `jobs` to find the job number):
`disown %{{job_number}}` `disown %{{job_number}}`
- Disown all jobs: - Disown all jobs (Bash only):
`disown -a` `disown -a`
- Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit: - Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit (Bash only):
`disown -h %{{job_number}}` `disown -h %{{job_number}}`

View file

@ -1,6 +1,7 @@
# echo # echo
> Print given arguments. > Print given arguments.
> See also: `printf`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html>. > More information: <https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html>.
- Print a text message. Note: Quotes are optional: - Print a text message. Note: Quotes are optional:

View file

@ -1,12 +1,13 @@
# fg # fg
> Run jobs in foreground. > Run jobs in foreground.
> See also: `jobs`, `bg` and `disown`.
> More information: <https://manned.org/fg>. > More information: <https://manned.org/fg>.
- Bring most recently suspended or running background job to foreground: - Bring most recently suspended or running background job to foreground:
`fg` `fg`
- Bring a specific job to foreground: - Bring a specific job to foreground (run `jobs` to find the job number):
`fg %{{job_id}}` `fg %{{job_number}}`

View file

@ -1,7 +1,7 @@
# local # local
> Declare local variables and give them attributes. > Declare local variables and give them attributes.
> See also: `declare`. > See also: `declare` and `export`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-local>. > More information: <https://www.gnu.org/software/bash/manual/bash.html#index-local>.
- Declare a string variable with the specified value: - Declare a string variable with the specified value:

View file

@ -1,7 +1,7 @@
# popd # popd
> Remove a directory placed on the directory stack via the pushd shell built-in. > 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. > 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#index-popd>. > 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: - Remove the top directory from the stack and cd to it:

View file

@ -1,6 +1,7 @@
# printf # printf
> Format and print text. > Format and print text.
> See also: `echo`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/printf-invocation.html>. > More information: <https://www.gnu.org/software/coreutils/manual/html_node/printf-invocation.html>.
- Print a text message: - Print a text message:

View file

@ -1,7 +1,7 @@
# pushd # pushd
> Place a directory on a stack so it can be accessed later. > Place a directory on a stack so it can be accessed later.
> See also `popd` to switch back to original directory and `dirs` to display directory stack contents. > See also: `popd` to switch back to original directory and `dirs` to display directory stack contents.
> More information: <https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html#index-pushd>. > More information: <https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html#index-pushd>.
- Switch to directory and push it on the stack: - Switch to directory and push it on the stack:

View file

@ -23,3 +23,7 @@
- If A is true, then do B, or C in the case of an error (notice that C may run even if A fails): - If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):
`test {{condition}} && {{echo "true"}} || {{echo "false"}}` `test {{condition}} && {{echo "true"}} || {{echo "false"}}`
- Use `test` in a conditional statement:
`if test -f "{{path/to/file}}"; then echo "File exists"; else echo "File does not exist"; fi`

View file

@ -1,6 +1,7 @@
# unalias # unalias
> Remove aliases. > Remove aliases.
> See also: `alias`.
> More information: <https://manned.org/unalias>. > More information: <https://manned.org/unalias>.
- Remove an alias: - Remove an alias:

View file

@ -1,6 +1,7 @@
# wait # wait
> Wait for a process to complete before proceeding. > Wait for a process to complete before proceeding.
> See also: `ps` to view information about running processes.
> More information: <https://manned.org/wait>. > More information: <https://manned.org/wait>.
- Wait for a process to finish given its process ID (PID) and return its exit status: - Wait for a process to finish given its process ID (PID) and return its exit status:
@ -11,7 +12,7 @@
`wait` `wait`
- Wait for a job to finish: - Wait for a job to finish (run `jobs` to find the job number):
`wait %{{job_number}}` `wait %{{job_number}}`