Linux#
Bash#
Special parameters
$-the shell is interactive if the value contains ani$?return value of previous command$0shell?
Builtin commands
sh[ortest.orsource:breakcdcontinueevalexecexitexportgetoptshashpwdreadonlyreturnsetshifttimestrapumaskunsetremoves variables
bashaliasbindbuiltincommanddeclarecreates variablesechoenablehelpletlocallogoutprintfreadshopttypetypesetulimitunalias
special
Environment variables
BASH_ENVENVPATHSHELLSHELLOPTS
Conditional
[[compound commandtestbuiltin[builtinunary, binary expression
unary expressions are often used to examine the status of a file
File descriptors
0/dev/stdin1/dev/stdout2/dev/stderrN/dev/fd/N
Arithmetic
expansion
letbuiltinevaluation 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
declarebuiltin
directory stack
pushdbuiltinpopdbuiltindirscommand
redirection
>>|><>&&>>>