Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a347ae6
Update return.md
Managor Dec 12, 2025
5b70a18
Update [.md
Managor Dec 12, 2025
7291e24
Update return.md
Managor Dec 12, 2025
3a2e3c8
Update [.md
Managor Dec 12, 2025
9372888
Update command.md
Managor Dec 12, 2025
b69b441
Update command.md
Managor Dec 13, 2025
e8b5261
Update continue.md
Managor Dec 13, 2025
1d20140
Update enable.md
Managor Dec 13, 2025
c070a86
Update enable.md
Managor Dec 13, 2025
9af64d5
Update bg.md
Managor Dec 13, 2025
51f9e53
Update [[.md
Managor Dec 13, 2025
a78d31e
Update false.md
Managor Dec 13, 2025
7f27265
Update true.md
Managor Dec 13, 2025
75ca19c
Update shopt.md
Managor Dec 13, 2025
ac69855
Update shift.md
Managor Dec 13, 2025
8f8d6e6
Update shift.md
Managor Dec 13, 2025
3a57727
Update shift.md
Managor Dec 13, 2025
729e4e6
Update fc.md
Managor Dec 13, 2025
3a62217
Update fc.md
Managor Dec 13, 2025
f48059b
Update jobs.md
Managor Dec 13, 2025
9a76f6b
Update fg.md
Managor Dec 13, 2025
a92841d
Update getopts.md
Managor Dec 13, 2025
182b670
Update help.md
Managor Dec 13, 2025
79b2915
Update let.md
Managor Dec 13, 2025
758e4fd
Update times.md
Managor Dec 13, 2025
b604e99
Update times.md
Managor Dec 13, 2025
5ab8739
Update true.md
Managor Dec 13, 2025
926a2a4
Update false.md
Managor Dec 13, 2025
2f78231
Update ulimit.md
Managor Dec 13, 2025
8c9f7b9
Update unset.md
Managor Dec 13, 2025
d999e1a
Update time.md
Managor Dec 13, 2025
a0945cc
Update times.md
Managor Dec 13, 2025
9102759
Update for.md
Managor Dec 13, 2025
db474f8
Update [[.md
Managor Dec 13, 2025
917537c
Merge branch 'main' into bash-builtin
Managor Dec 13, 2025
13e2b88
Update false.md
Managor Dec 15, 2025
0542f91
Update true.md
Managor Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pages/common/[.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
> See also: `test`.
> More information: <https://gnu.org/software/bash/manual/bash.html#index-test>.
- Test if a given variable is equal/not equal to the specified string:
- Test if a given variable is equal to the specified string:

`[ "${{variable}}" {{=|!=}} "{{string}}" ]`
`[ "${{variable}}" = "{{string}}" ]`

- Test if a given variable is not equal to the specified string:

`[ "${{variable}}" != "{{string}}" ]`

- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number:

Check failure on line 16 in pages/common/[.md

View workflow job for this annotation

GitHub Actions / build

ot ==> to, of, or, not, it

`[ "${{variable}}" -{{eq|ne|gt|lt|ge|le}} {{integer}} ]`

Expand Down
8 changes: 4 additions & 4 deletions pages/common/[[.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
> Returns a status of 0 if the condition evaluates to true, 1 if it evaluates to false.
> More information: <https://gnu.org/software/bash/manual/bash.html#index-_005b_005b>.

- Test if a given variable is equal/not equal to the specified string:
- Test if a given variable is equal to the specified string or glob:

`[[ ${{variable}} {{==|!=}} "{{string}}" ]]`
`[[ ${{variable}} == "{{string}}" ]]`

- Test if a given string conforms the specified glob/`regex`:
- Test if a given string conforms the specified `regex`:

`[[ ${{variable}} {{==|=~}} {{pattern}} ]]`
`[[ ${{variable}} =~ {{pattern}} ]]`

- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number:

Check failure on line 15 in pages/common/[[.md

View workflow job for this annotation

GitHub Actions / build

ot ==> to, of, or, not, it

`[[ ${{variable}} -{{eq|ne|gt|lt|ge|le}} {{integer}} ]]`

Expand Down
2 changes: 1 addition & 1 deletion pages/common/bg.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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 keep them running in the background.
> See also: `jobs`, `fg`, `disown`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-bg>.

Expand Down
2 changes: 1 addition & 1 deletion pages/common/command.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# command

> Command forces the shell to execute the program and ignore any functions, builtins and aliases with the same name.
> Force the shell to execute the program and ignore any functions, builtins, and aliases with the same name.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-command>.

- Execute the `ls` program literally, even if an `ls` alias exists:
Expand Down
2 changes: 1 addition & 1 deletion pages/common/continue.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# continue

> Skip to the next iteration of a `for`, `while`, `until` or `select` loop.
> Skip to the next iteration of a `for`, `while`, `until`, or `select` loop.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-continue>.

- Skip to the next iteration:
Expand Down
4 changes: 4 additions & 0 deletions pages/common/enable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
- Disable a builtin (works in Bash only):

`enable -n {{command}}`

- Re-enable a builtin:

`enable {{command}}`
6 changes: 5 additions & 1 deletion pages/common/false.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# false

> Returns a non-zero exit code.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/false-invocation.html>.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-false>.

- Return a non-zero exit code:

`false`

- Make a command always exit with 1:

`{{command}} && false`
3 changes: 2 additions & 1 deletion pages/common/fc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# fc

> Open the most recent command for editing and then run it.
> Open the recent commands for editing and then run them.
> See also: `history`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-fc>.

- Open the last command in the default system editor and run it after editing:
Expand Down
2 changes: 1 addition & 1 deletion pages/common/fg.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fg

> Run jobs in foreground.
> See also: `jobs`, `bg`, `disown`.
> See also: `jobs`, `bg`, `disown`, `%`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-fg>.

- Bring most recently suspended or running background job to foreground:
Expand Down
2 changes: 1 addition & 1 deletion pages/common/for.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> Perform a command several times.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Looping-Constructs>.

- Iterate through command line arguments:
- Iterate through command line parameters:

`for {{variable}}; do {{echo $variable}}; done`

Expand Down
2 changes: 1 addition & 1 deletion pages/common/getopts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# getopts

> Parse shell options from arguments.
> This command does not support longform options and thus using `getopt` is recommended instead.
> Note: This command does not support longform options and thus using `getopt` is recommended instead.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-getopts>.

- Check if an option is the first set option in the current context:
Expand Down
4 changes: 2 additions & 2 deletions pages/common/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

- Print instructions on how to use `[[ ]]` for conditional commands:

`help [[ ]]`
`help [[`

- Print instruction on how to use `(( ))` to evaluate arithmetic expressions:

`help \( \)`
`help \(`

- Print instructions on how to use the `cd` command:

Expand Down
1 change: 0 additions & 1 deletion pages/common/let.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# let

> Evaluate arithmetic expressions in shell.
> Supports variables, operators, and conditional expressions.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-let>.

- Evaluate a simple arithmetic expression:
Expand Down
4 changes: 3 additions & 1 deletion pages/common/return.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# return

> Exit a function or a script if run with `source`.
> Exit a function.
> Can exit out of a script if run with `source`.
> See also: `exit`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-return>.

- Exit a function prematurely:
Expand Down
2 changes: 1 addition & 1 deletion pages/common/shopt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
> Generic POSIX shell variables (stored in `$SHELLOPTS`) are managed with the `set` command instead.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#The-Shopt-Builtin>.

- List of all settable options and whether they are set:
- List of all setable options and whether they are set:

`shopt`

Expand Down
2 changes: 1 addition & 1 deletion pages/common/time.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# time

> Measure how long a command took to run.
> Note: `time` can either exist as a shell builtin, a standalone program or both.
> Note: `time` can either exist as a shell builtin, a standalone program, or both.
> See also: `times`.
> More information: <https://manned.org/time>.

Expand Down
3 changes: 2 additions & 1 deletion pages/common/times.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# times

> Print the cumulative CPU usage time of the current shell.
> First line is current shell CPU usage for User and System. Second is all child processes.
> See also: `time`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-times>.

- Print CPU usage. First line is current shell CPU usage for User and System. Second is all child processes:
- Print CPU usage:

`times`
7 changes: 5 additions & 2 deletions pages/common/true.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# true

> Returns a successful exit status code of 0.
> Use this with the || operator to make a command always exit with 0.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/true-invocation.html>.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-true>.

- Return a successful exit code:

`true`

- Make a command always exit with 0:

`{{command}} || true`
2 changes: 1 addition & 1 deletion pages/common/ulimit.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ulimit

> Get and set resource limits for user processes.
> It is a shell builtin hence not shell-agnostic.
> This is a shell builtin hence not shell-agnostic.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-ulimit>.

- Get the properties of all the user limits:
Expand Down
12 changes: 6 additions & 6 deletions pages/common/unset.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
> Remove shell variables or functions.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-unset>.

- Remove the variable `foo`, or if the variable doesn't exist, remove the function `foo`:
- Remove variable, or if the variable doesn't exist, remove the function of the same name:

`unset {{foo}}`
`unset {{variable}}`

- Remove the variables foo and bar:
- Remove variables:

`unset -v {{foo}} {{bar}}`
`unset -v {{variable1 variable2 ...}}`

- Remove the function my_func:
- Remove the function:

`unset -f {{my_func}}`
`unset -f {{function_name1 function_name2}}`
1 change: 1 addition & 0 deletions pages/linux/jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

> Shell builtin for viewing information about processes spawned by the current shell.
> Options other than `-l` and `-p` are exclusive to Bash.
> See also: `fg`, `bg`, `disown`, `%`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-jobs>.

- View jobs spawned by the current shell:
Expand Down
Loading