Bash
Special Charactes
# Octothorp:
Comment
Pattern Matching
; Semicolon: Command Separator
;; Double Semicolon: Case Terminator
. Period/Dot
Source
Component of a file name
Hidden file prefix
Current directory
Double dot: Parent Directory
Character match: Match a single character
" Double quote: Partial quoting
' Single quote: Full quoting
, Comma: Link aritithmetic operations
\ Back slash: escape
/ Forward slash
Path separator
Arithmetic divide operator
` Back tick: Command Substitution
: Colon: Null Command
* Asterisk
Wild card: match all characters
Pattern Matching: match zero or more
Arithmetic: multiplication operator
Double Asterisk: exponentiation operator
? Test operator
Double parenthesis context: trinary operator
Parameter Substitution: test if variable set
Wild card: match one character
Pattern matching: represent one character
$ Dollar Sign
Variable substitution: $a
Regular Expression: Match end-of-line
${} See:
Parameter Substitution
Postitional Parameters: $*, $@
Exit status: $?
Process ID; $$
() Parenthesis
Command group (a='hello'; echo $a): starts a subshell
Array initialization array_a=(elem1 elem2 elem3)
{} Braces
Brace Expansion: cat {file1,file2,file3} > combined_file
Extended Brace Expansion: echo {a..z} --> echos chars from a to z
Code block: anonymous function
Text place holder: ls . | xargs -i -t cp ./{} $1
Path name: find . -type f -exec file '{}' \; (semi-colon ends -exec option and must be escaped)
[ ] Brackets
[ ] Test
[[ ]] Test
Array element: ${array_a[0]}
Regular expression: Character Range [a-z]
(( )) Integer expression
Parameter Substitution
Send mail to the Webmaster
This site best viewed with a browser
Warning: This is a Debian centric site and MAY contain peanuts.
Many thanks to Debra Lynn and Ian Murdock for making Debian possible
First created Apr 22, 2008 ~ Last revised September 06, 2009