
作业
1. 下面哪个命令能把文件myfile重命名为mynewfile ?
a. mv myfile mynewfile
b. rm myfile mynewfile
c. rn myfile mynewfile
d. ren myfile mynewfile
2. 下面哪个命令可以创建/home的软链接到/tmp/xx ?
a. ln /tmp/xx /home
b. ln /home /tmp/xx
c. ln -s /home /tmp/xx
d. ln -s /tmp/xx /home
3. 下面哪个命令可以查看文件的前10行?
a. head
b. top
c. first
d. cat
4. 下面哪个命令可以查看一个文本文件的行数?
a. count
b. list
c. ls -l
d. wc
5. 在使用less命令查看文档时,按哪个键能退出当前的文本文件?
a. End
b. PgDn
c. Q
d. G
6. ls的结果非常多,想借助less查看ls的输出结果,下面哪个命令正确?
a. ls > less
b. ls >> less
c. ls >| less
d. ls | less
7. 如果要查看/etc/passwd的第5行到第10行的内容,应该使用下面哪个命令?
a. head –n 5-10 /etc/passwd
b. head /etc/passwd | tail -5
c. top –n 5-10 /etc/passwd
d. head /etc/passwd | tail -6
8. 某脚本aa.sh运行时,不管是对还是错,希望把输出重定向到aa.txt中的写法是哪个?
a. ./aa.sh > aa.txt
b. ./aa.sh 2 > aa.txt
c. ./aa 1 > aa.txt
d. ./aa.sh & > aa.txt
9. 如果想把/etc/service拷贝到/opt中同时保留属性不变,下面哪个命令能实现?
a. cp /etc/service /opt
b. cp –r /etc/service /opt
c. cp –a /etc/service /opt
d. cp –p /etc/service /opt
10. 执行date命令,想把命令的结果显示在屏幕上,同时保存在aa.txt中,下面哪个命令能实现?
a. date | tee aa.txt
b. date > aa.txt
c. date & > aa.txt
d. date 2 > aa.txt