bg sends the job to the background resuming it if it has stopped.
Returns true if the value given to it is equal to '1' or 'true'.
Without arguments cd changes the working directory to your home directory.
With arguments cd changes the working directory to the directory you provided.
contains <PATTERN> tests...
Returns 0 if the first argument contains any of the other ones, else returns 1
If DEPTH is given, set the dir stack max depth to DEPTH, else remove the limit
dirs prints the current directory stack.
disown [ --help | -r | -h | -a ][PID...]
Disowning a process removes that process from the shell's background process table.
-r Remove all running jobs from the background process list.
-h Specifies that each job supplied will not receive the SIGHUP signal when the shell receives a SIGHUP.
-a If no job IDs were supplied, remove all jobs from the background process list.
Deletes the variables given to it as arguments. The variables name must be supplied.
Instead of '$x' use 'x'.
echo [ -h | --help ] [-e] [-n] [-s] [STRING]...
Print the STRING(s) to standard output.
enable the interpretation of backslash escapes
do not output the trailing newline
do not separate arguments with spaces
When the -e argument is used, the following sequences will be interpreted:
\a alert (BEL)
\b backspace (BS)
\c produce no further output
\e escape (ESC)
\f form feed (FF)
\n new line
\r carriage return
\t horizontal tab (HT)
\v vertical tab (VT)
ends-with <PATTERN> tests...
Returns 0 if the first argument ends with any of the other ones, else returns 1
eval evaluates the given arguments as a command. If more than one argument is given,
all arguments are joined using a space as a separator.
exec [-ch] [--help] [command [arguments ...]]
Execute <command>, replacing the shell with the specified program.
The <arguments> following the command become the arguments to
-c Execute command with an empty environment.
Checks whether the given item exists and returns an exit status of 0 if it does, else 1.
array var is not empty
binary is in PATH
path is a directory
This is the same as test -d
path is a file
This is the same as test -f
function is defined
string var is not empty
string is not empty
This is the same as test -n
Test if the file exists:
exists -f FILE && echo 'The FILE exists' || echo 'The FILE does not exist'
Test if some-command exists in the path and is executable:
exists -b some-command && echo 'some-command exists' || echo 'some-command does not exist'
Test if variable exists AND is not empty
exists -s myVar && echo "myVar exists: $myVar" || echo 'myVar does not exist or is empty'
NOTE: Don't use the '$' sigil, but only the name of the variable to check
Test if array exists and is not empty
exists -a myArr && echo "myArr exists: @myArr" || echo 'myArr does not exist or is empty'
NOTE: Don't use the '@' sigil, but only the name of the array to check
Test if a function named 'myFunc' exists
exists --fn myFunc && myFunc || echo 'No function with name myFunc found'
Written by Fabian Würfl.
Heavily based on implementation of the test builtin, which was written by Michael Murphy.
Makes ion exit. The exit status will be that of the last command executed.
Sets the exit status to 1.
fg brings the specified job to foreground resuming it if it has stopped.
fn [ -h | --help ]
Prints all the defined functions along with their help, if provided
Get the short description for BUILTIN. If no argument is provided, list all the builtins
Prints or manupulate the command history.
+inc_append: Append each command to history as entered.
-inc_append: Default, do not append each command to history as entered.
+shared: Share history between shells using the same history file, implies inc_append.
-shared: Default, do not share shell history.
+duplicates: Default, allow duplicates in history.
-duplicates: Do not allow duplicates in history.
is [ -h | --help ] [not]
Returns 0 if the two arguments are equal, and 1 otherwise.
returns 0 if the two arguments are not equal.
Returns 0 if the supplied file descriptor is a tty, and 1 otherwise.
Prints a list of all jobs running in the background.
matches VALUE VALUE
Makes the exit status equal 0 if the first argument contains the second.
Otherwise matches makes the exit status equal 1.
matches xs x
matches x xs
Evaluates arithmetic expressions
help (only in interactive mode)
prints this help text
--help (only in non-interactive mode)
prints this help text
exit (only in interactive mode)
exits the program
e.g. 3 * 4 + 5
e.g. + * 3 4 5
Add two plus two in infix notation
Add two plus two in polish notation
math + 2 2
Written by Hunter Goldstein.
popd removes the top directory from the directory stack and changes the working directory to the new top directory.
pushd adds directories to the stack.
pushd pushes a directory to the directory stack.
random START END
random generates a pseudo-random integer. IT IS NOT SECURE.
The range is half open and depends on what arguments you pass.
If no arguments are given the range is [0, 32767).
If two arguments are given the range is [START, END).
For each variable reads from standard input and stores the results in the variable.
set [ --help ] [-e | +e] [-x | +x] [-o [vi | emacs]] [- | --] [STRING]...
Shell options may be set using the '-' character, and unset using the '+' character.
-e Exit immediately if a command exits with a non-zero status.
-o Specifies that an argument will follow that sets the key map.
The keymap argument may be either `vi` or `emacs`.
-x Specifies that commands will be printed as they are executed.
-- Following arguments will be set as positional arguments in the shell.
If no argument are supplied, arguments will be unset.
- Following arguments will be set as positional arguments in the shell.
If no arguments are suppled, arguments will not be unset.
Evaluates the commands in a specified file in the current shell. All changes in shell
variables will affect the current shell because of this.
starts-with <PATTERN> tests...
Returns 0 if the first argument starts with any of the other ones, else returns 1
status [ -h | --help ] [-l] [-i]
With no arguments status displays the current login information of the shell.
returns true if the shell is a login shell. Also --is-login.
returns true if the shell is interactive. Also --is-interactive.
prints the filename of the currently running script or else stdio. Also --current-filename.
Suspends the current shell by sending it the SIGTSTP signal,
returning to the parent process. It can be resumed by sending it SIGCONT.
Tests the expressions given and returns an exit status of 0 if true, else 1.
prints this help text
the length of STRING is nonzero
equivalent to -n STRING
the length of STRING is zero
STRING = STRING
the strings are equivalent
STRING != STRING
the strings are not equal
INTEGER -eq INTEGER
the integers are equal
INTEGER -ge INTEGER
the first INTEGER is greater than or equal to the second INTEGER
INTEGER -gt INTEGER
the first INTEGER is greater than the second INTEGER
INTEGER -le INTEGER
the first INTEGER is less than or equal to the second INTEGER
INTEGER -lt INTEGER
the first INTEGER is less than the second INTEGER
INTEGER -ne INTEGER
the first INTEGER is not equal to the second INTEGER
FILE -ef FILE
both files have the same device and inode numbers
FILE -nt FILE
the first FILE is newer than the second FILE
FILE -ot FILE
the first file is older than the second FILE
FILE exists and is a block device
FILE exists and is a character device
FILE exists and is a directory
FILE exists and is a regular file
FILE exists and is a symbolic link (same as -L)
FILE exists and is a symbolic link (same as -h)
FILE exists and read permission is granted
FILE exists and has a file size greater than zero
FILE exists and is a socket
FILE exists and write permission is granted
FILE exists and execute (or search) permission is granted
Test if the file exists:
test -e FILE && echo "The FILE exists" || echo "The FILE does not exist"
Test if the file exists and is a regular file, and if so, write to it:
test -f FILE && echo "Hello, FILE" >> FILE || echo "Cannot write to a directory"
Test if 10 is greater than 5:
test 10 -gt 5 && echo "10 is greater than 5" || echo "10 is not greater than 5"
Test if the user is running a 64-bit OS (POSIX environment only):
test $(getconf LONG_BIT) = 64 && echo "64-bit OS" || echo "32-bit OS"
Written by Michael Murphy.
Sets the exit status to 0.
Wait for the background jobs to finish
The which utility takes a list of command names and searches for the
alias/builtin/function/executable that would be executed if you ran that command.