**
题目
**
1.显示当前时间,显示格式为hh:mm:ss,并保存到文件time.txt文件中
2.显示/etc/passwd文件的第15-18行内容
3.显示/bin中文件包含大写字母的文件,保存到bin_westos_file.txt文件中,并统计个数显示到屏幕
4.在student用户下查找/etc下passwd文件,屏蔽错误输出
5.在student用户下查找/etc下passwd文件,正确输出保存到/tmp/westos.out ,错误输出保存到/tmp/westos.err
6.在student用户下查找/etc下passwd文件,显示命令输出并保存输出到/tmp/westos.all中
命令
1.通过管道实现显示并保存
[student@localhost Desktop]$ date +%T | tee time.txt
2.通过先查看前十八行,通过管道作为输入查看15-18行
[student@localhost Desktop]$ head -n 18 /etc/passwd | tail -n4
3.通过管道实现显示–>保存–>显示
[student@localhost Desktop]$ ls /bin/*[[:upper:]]*
[student@localhost Desktop]$ find /bin/*[[:upper:]]* | tee bin_westos_file.txt | wc -l
4.通过定向输出实现
[student@localhost Desktop]$ find /etc/ -name passwd 2> /dev/null
5.通过定向输入与输出实现
[student@localhost Desktop]$ find /etc/ -name passwd 2> /tmp/westos.err > /tmp/westos.out
6.通过管道与定向输出实现
[student@localhost Desktop]$ find /etc/ -name passwd 2>&1 | tee /tmp/westos.all