命令顺序执行。区别在于,命令一的正确输出作为命令2的操作对象
[root@andy ~]# ls -l /etc | more
所以,相应来说,管道符的命令要更加严格一点
[root@andy ~]# netstat -an | grep ESTABLISHED | wc -l
1
这个是以后常用的服务器的命令
9.3.5 通配符
--
可以匹配其他字符的符号
? * [] [a-z] [^0-9]
真的就类似正则表达式中的东西。
用法
[root@andy ~]# ls ja*
anaconda-ks.cfg cangls juls
[root@andy ~]# ls japan
anaconda-ks.cfg cangls juls
主要用来匹配文件名或者目录的东西;要匹配文件中的内容,就真的用正则表达式了
--特殊
$变量,取变量的值
‘’ 单引号中所有的特殊符号($`反引号)都没有意义;“”,特殊字符中的\ ` $有含义
$(),用来引用系统命令,和反引号一样,但推荐使用这个
[root@andy ~]# aa=$(ls)
[root@andy ~]# $aa
-bash: anaconda-ks.cfg: command not found
[root@andy ~]# echo $aa
anaconda-ks.cfg cangls hello.sh install.log install.log.syslog japan test2.log test3.log test.log
[root@andy ~]# echo '$aa'
$aa
[root@andy ~]# echo "$aa"
anaconda-ks.cfg
cangls
hello.sh
install.log
install.log.syslog
japan
test2.log
test3.log
test.log