# 查看版本
bash --version
# show the current shell.
echo $SHELL
# displays all installed shell.
cat -n /etc/shells
- command :
cat
- option :
-n
- parameter :
/etc/shells
- Pipeline
- Looping
- Conditional
- Grouping
Character | Meaning |
---|
$0 | |
$1 | |
$@ | subshell |
$# | subshell |
$? | exit status of the most recently executed foreground pipeline |
$- | |
$$ | |
$! | |
Character | Meaning |
---|
# | Comment |
` | Command substitution (archaic) |
$ | Variable expression |
( | Start subshell |
) | End subshell |
\ | Quote next character |
& | Background job |
{ | Start command block |
} | End command block |
; | Shell command separator |
' | Strong quote |
" | Weak quote |
! | Pipeline logical NOT |
Character | Meaning |
---|
* | String wildcard |
? | Single-character wildcard |
[ | Start character-set wildcard |
] | End character-set wildcard |
Character | Meaning |
---|
/ | Root directory |
/ | Pathname directory separator |
~ | Home directory |
Character | Meaning |
---|
| | Pipe |
< | Input redirect |
> | Output redirect |
>> | Append redirect (if file exists) |
2> | Error output redirect |
2>&1 | Send error to output redirect |