输出重定向:讲要输出到屏幕上的信息,写到制定的文件中。
表达式一:命令>文件 (清空原有数据)
[root@VM-4-6-centos ~]# man bash>readme.txt
[root@VM-4-6-centos ~]# head --lines=2 readme.txt
[root@VM-4-6-centos ~]# echo "Welcome to LinuxProbe.Com" > readme.txt (覆盖了)
表达式一:命令>>文件 (追加到原有数据后面)
[root@VM-4-6-centos ~]# echo "Quality linux learning materials" >> readme.txt
[root@VM-4-6-centos ~]# cat readme.txt
Welcome to LinuxProbe.Com
Quality linux learning materials
[root@VM-4-6-centos ~]#
统计行数
wc -l <readme.txt
管道命令符号:
[root@VM-4-6-centos ~]# echo "@J534s073j." | passwd --stdin root
Changing password for user root.
passwd: all authentication tokens updated successfully.
[root@VM-4-6-centos ~]#