Skip to content

Commit 8bc9dce

Browse files
pranaovsManagorsebastiaanspeckacuteenvy
authored
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>
1 parent 6b116b1 commit 8bc9dce

File tree

14 files changed

+43
-15
lines changed

14 files changed

+43
-15
lines changed

pages/common/alias.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# alias
22

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

pages/common/bg.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# bg
22

33
> Resume suspended jobs (e.g. using `<Ctrl z>`), and keeps them running in the background.
4+
> See also: `jobs`, `fg` and `disown`.
45
> More information: <https://manned.org/bg>.
56
67
- Resume the most recently suspended job and run it in the background:
78

89
`bg`
910

10-
- Resume a specific job (use `jobs -l` to get its ID) and run it in the background:
11+
- Resume a specific job and run it in the background (run `jobs` to find the job number):
1112

12-
`bg %{{job_id}}`
13+
`bg %{{job_number}}`

pages/common/command.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
`command {{ls}}`
99

10+
- 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:
11+
12+
`command -p {{command_name}}`
13+
1014
- Display the path to the executable or the alias definition of a specific command:
1115

1216
`command -v {{command_name}}`

pages/common/dirs.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
> Display or manipulate the directory stack.
44
> The directory stack is a list of recently visited directories that can be manipulated with the `pushd` and `popd` commands.
5+
> See also: `pushd`, `popd`.
56
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Directory-Stack-Builtins>.
67
78
- Display the directory stack with a space between each entry:
@@ -12,10 +13,22 @@
1213

1314
`dirs -p`
1415

15-
- Display only the `n`th entry in the directory stack, starting at 0:
16+
- Display a numbered list of entries in the directory stack:
17+
18+
`dirs -v`
19+
20+
- Display the directory stack without the tilde-prefix (`~`):
21+
22+
`dirs -l`
23+
24+
- Display only the `n`th entry in the directory stack, starting at 0 (Bash only):
1625

1726
`dirs +{{n}}`
1827

28+
- Display only the `n`th entry in the directory stack from the last, starting at 0 (Bash only):
29+
30+
`dirs -{{n}}`
31+
1932
- Clear the directory stack:
2033

2134
`dirs -c`

pages/common/disown.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# disown
22

33
> Allow sub-processes to live beyond the shell that they are attached to.
4-
> See also the `jobs` command.
4+
> See also: `jobs` for finding job numbers.
55
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-disown>.
66
77
- Disown the current job:
88

99
`disown`
1010

11-
- Disown a specific job:
11+
- Disown a specific job (run `jobs` to find the job number):
1212

1313
`disown %{{job_number}}`
1414

15-
- Disown all jobs:
15+
- Disown all jobs (Bash only):
1616

1717
`disown -a`
1818

19-
- Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit:
19+
- Keep job (do not disown it), but mark it so that no future SIGHUP is received on shell exit (Bash only):
2020

2121
`disown -h %{{job_number}}`

pages/common/echo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# echo
22

33
> Print given arguments.
4+
> See also: `printf`.
45
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html>.
56
67
- Print a text message. Note: Quotes are optional:

pages/common/fg.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# fg
22

33
> Run jobs in foreground.
4+
> See also: `jobs`, `bg` and `disown`.
45
> More information: <https://manned.org/fg>.
56
67
- Bring most recently suspended or running background job to foreground:
78

89
`fg`
910

10-
- Bring a specific job to foreground:
11+
- Bring a specific job to foreground (run `jobs` to find the job number):
1112

12-
`fg %{{job_id}}`
13+
`fg %{{job_number}}`

pages/common/local.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# local
22

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

pages/common/popd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# popd
22

33
> Remove a directory placed on the directory stack via the pushd shell built-in.
4-
> See also `pushd` to place a directory on the stack and `dirs` to display directory stack contents.
4+
> See also: `pushd` to place a directory on the stack and `dirs` to display directory stack contents.
55
> More information: <https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html#index-popd>.
66
77
- Remove the top directory from the stack and cd to it:

pages/common/printf.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# printf
22

33
> Format and print text.
4+
> See also: `echo`.
45
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/printf-invocation.html>.
56
67
- Print a text message:

pages/common/pushd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pushd
22

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

pages/common/test.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@
2323
- If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):
2424

2525
`test {{condition}} && {{echo "true"}} || {{echo "false"}}`
26+
27+
- Use `test` in a conditional statement:
28+
29+
`if test -f "{{path/to/file}}"; then echo "File exists"; else echo "File does not exist"; fi`

pages/common/unalias.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# unalias
22

33
> Remove aliases.
4+
> See also: `alias`.
45
> More information: <https://manned.org/unalias>.
56
67
- Remove an alias:

pages/common/wait.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# wait
22

33
> Wait for a process to complete before proceeding.
4+
> See also: `ps` to view information about running processes.
45
> More information: <https://manned.org/wait>.
56
67
- Wait for a process to finish given its process ID (PID) and return its exit status:
@@ -11,7 +12,7 @@
1112

1213
`wait`
1314

14-
- Wait for a job to finish:
15+
- Wait for a job to finish (run `jobs` to find the job number):
1516

1617
`wait %{{job_number}}`
1718

0 commit comments

Comments
 (0)