11. 编辑你重新定义的PS1 到你的.bashrc,然后打开新的终端窗口看看结果如何.
步骤3:配置shell选项
情景/故事:
使用set和shopt你定制几个bash shell 。
任务:
12.以student身份登录tty1界面上.查看许多普遍的配置shell选项:
$ set –o
allexport off
braceexpand on
emacs on
errexit off
hashall on
… output truncated …
13.察看目前ignoreeof的属性,用ctrl+d 键看是否能logout.
14.用student身份在tty1上登录,执行下面的改变,然后测试ignoreeof选项:
$ set –o ignoreeof
$ <ctrl-d>
$ 用 “logout” 退出shell
$ set +o ignoreeof
$ <ctrl-d>
15.当试图执行命令的时候可以看到提示信息.使用type的命令:
$ type cat
cat is hashed (/bin/cat)
$ type cls
cls is aliased to ‘clear’
$ type set
shopt is a shell builtin
$ type while
while is a shell keyword
结果:
现在你有一个更好的shell options.
问题答案4:命令替代
1. 确定完全路径名
$ which metacity
$ which <esc>.-message
$ ^message^window-demo
2. 重复执行上一个包含字符串ig的命令:
$ <ctrl-r>ig<return>
3. 当一个命令在另一个命令的后面用(‘ ‘)起来的时候,bash会先执行后面的命令并把执行的结果作为第一个命令的输入. 使用这个技术,看看下面命令的执行结果.
$ ls –l ‘which nautilus‘
(end)
