Linux#
Bash#
Special parameters
$-
the shell is interactive if the value contains ani
$?
return value of previous command$0
shell?
Builtin commands
sh
[
ortest
.
orsource
:
break
cd
continue
eval
exec
exit
export
getopts
hash
pwd
readonly
return
set
shift
times
trap
umask
unset
removes variables
bash
alias
bind
builtin
command
declare
creates variablesecho
enable
help
let
local
logout
printf
read
shopt
type
typeset
ulimit
unalias
special
Environment variables
BASH_ENV
ENV
PATH
SHELL
SHELLOPTS
Conditional
[[
compound commandtest
builtin[
builtinunary, binary expression
unary expressions are often used to examine the status of a file
File descriptors
0
/dev/stdin
1
/dev/stdout
2
/dev/stderr
N
/dev/fd/N
Arithmetic
expansion
let
builtinevaluation is done in fixed-width integers with no check for overflow; division by zero is trapped and flagged as an error; operators and their precedence and associativity follow C
Arrays
one-dimensional
zero-indexed
declare
builtin
directory stack
pushd
builtinpopd
builtindirs
command
redirection
>
>|
><
>&
&>
>>