RHCE笔记整理-RH033.Unit4-The Bash shell
1. Bash :Bourne Again Shell
作用:将用户输入的指令解析成linux kernel能够识别的语言,是用户与系统勾通的桥梁。
2. Bash 历史
--System V:sh--------->Bash
Unix
--BSD:csh-->ksh
tchsh-------------------
zsh
3. File Globbing
• Globbing is wildcard expansion
* mathes zero or more characters
? matches any single character
[a-z] matches a range of characters
[^a-z] matches all except the range
4. The Tab Key
5. History
Command:history
Usage:
• history命令结果 会输出指令的序号和指令的名称,要使用某一序号的指令,可进行如下操作:!指令序号
• 要修改上一条指令可进行操作:^source^dest
例:#ping 192.168.1.123
#^123^1
则修改后的指令为ping 192.168.1.1
6. The Use Of Tilde(~)
• Back to home directory
$cd ~
• change to other user's home directory
$cd ~username
7.如何在指令里使用变数及{}
8. 如何有摊中加入其它指令来显示电脑信息及用指令进行数学运算
• Command output '' or $()
例:$echo "Hostname:`hostname`"
or $echo "Hostname:$(hostname)"
• 数学运算:$[]
例:$a=3
$b=5
$c=7
$echo $[$a+$b] //a+b
$echo $[$a**$b] //a的b次方
建议使用时各参数都用空白隔开,这是标准的语法,各平台上都可以使用
9. Backslash
• Backslash is the escape character
例:$echo Your cost is $5.00
$Your cost is .00
$echo Your cost is \$5.00
$Your cost is $5.00
10. The use of quotes
• quoting prevents expansion
• Single quotes(`) inhibit all expansion
• Double quotes(") inhibit all expansion except
• $
• \
• `
• !
11. History Tricks
• use up and down to sroll through previous commands
• type
<Alt-.> 同时按下Alt+.
12. Command Editing Tricks
• By default bsh uses emacs-style
• type "set-o vi" to change keybinding ro vi-style
• set -o 查看电脑上的设定
• 切换编辑模式:
set -o vi 把默认的编辑器改为vi,其中-o表示“减off" 即为“on"
13. Gnome-terminal
•
•
•
•
•
[2008年3月7日星期五]
RHCE笔记整理-RH033.Unit4-The Bash shell
标签: 类UNIX系统, LINUX学习
订阅:
博文评论 (Atom)
0 评论:
发表评论