|
接触Linux也蛮长时间了,但是一直没有系统学习过BASH,这个暑假想系统学习一下BASH,我看的教材是《Bash Guide for Beginners》(bash 新手指南) ,我是主要看原版,偶尔对照中文版的看。今天看完第一章,然后做了一下书后的习题。现在想让诸位检查一下我做的答案是否有误。
说明: 下面的“A”表示我的回答
1. Where is the bash program located on your system?
A:$ which bash
2. Use the −−version option to find out which version you are running.
A: $ bash --version
3. Which shell configuration files are read when you login to your system using the graphical user interface and then opening a terminal window?
A: ~/.bashrc ~/.bash_profile /etc/profile
4. Are the following shells interactive shells? Are they login shells?
♦ A shell opened by clicking on the background of your graphical desktop, selecting "Terminal"
or such from a menu.
♦ A shell that you get after issuing the command ssh localhost.
♦ A shell that you get when logging in to the console in text mode.
♦ A shell obtained by the command xterm &.
Chapter 1. Bash and Bash scripts 19
Bash Guide for Beginners
♦ A shell opened by the mysystem.sh script.
♦ A shell that you get on a remote host, for which you didn't have to give the login and/or
password because you use SSH and maybe SSH keys.
A: 我至今没有搞明白什么叫做interactive shells ,如何判断,书中对此的解释我没有看懂,而且我Google了一下,似乎很难找到相关内容,谁帮我解释一下
5. Can you explain why bash does not exit when you type Ctrl+C on the command line?
A: 我猜可能BASH的代码里面有一个signal函数,用来Ctrl+C的信号
6. Display directory stack content.
A: $ dirs #这个是我Google 来的,不过似乎打印不出什么阿?
8. Display hashed commands for your current shell session.
A: $ hash
9. How many processes are currently running on your system? Use ps and wc, the first line of output of ps is not a process!
A : $ps aux | wc -l
10. How to display the system hostname? Only the name, nothing more!
A: $hostname |
|