[student@localhost Desktop]$ date +%T ##显示时间 格式为hh:mm:ss
[student@localhost Desktop]$ date +%T | tee time.txt ##显示时间 格式为hh:mm:ss复制一份并保存到time.txt
[student@localhost Desktop]$ cat time.txt ##查看文件time.txt
[student@localhost Desktop]$ head -n 18 /etc/passwd | tail -n 4 ##查看文件 /etc/passwd的前18行的后4行,即15到18行
[student@localhost Desktop]$ cat -b /etc/passwd | head -n 18 | tail -n 4 ##显示文件 /etc/passwd的15到18行的行号
[student@localhost Desktop]$ ls /bin/*[[:upper:]] * | tee bin_westos_file.txt | wc -l ##显示文件/bin中包含大写字母的文件,然后保存到文件bin_westos_file.txt中 ,并统计个数
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190704224422231.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDc4MzE2MA==,size_16,color_FFFFFF,t_70)
[student@localhost Desktop]$ find /etc/ -name passwd > file ##在student用户下查找/etc下passwd文件,屏蔽错误输出
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190704224921533.?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDc4MzE2MA==,size_16,color_FFFFFF,t_70)
[student@localhost Desktop]$ find /etc/ -name passwd > /tmp/westos.out 2> /tmp/westos.err ##在student用户下查找/etc下passwd文件,正确输出保存到/tmp/westos.out,错误输出保存到/tmp/westos.err
[student@localhost Desktop]$ cat /tmp/westos.out ##查看文件/tmp/westos.out的内容 [student@localhost Desktop]$ cat /tmp/westos.err ##查看文件/tmp/westos.out的内容
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190704225034641.?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDc4MzE2MA==,size_16,color_FFFFFF,t_70)
[student@localhost Desktop]$ find /etc/ -name passwd 2>&1 | tee /tmp/westos.all ###在student用户下查找/etc下passwd文件,显示命令输出并保存到文件/tmp/westos.all
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190704225345173.?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDc4MzE2MA==,size_16,color_FFFFFF,t_70)