|
*通配符(* 代表零个或多个任意字符)
1
| <span style="font-family:sans-serif;">[iyunv@localhost ~]# ls *.txt<br><br></span><span style="font-family:sans-serif;">a.txt<br><br></span><span style="font-family:sans-serif;">1.txt:<br><br></span><span style="font-family:sans-serif;">2.txt:</span>
|
?只代表一个任意的字符
1
2
3
4
| root@localhost ~]# touch testa
[iyunv@localhost ~]# touch testb.txt
[iyunv@localhost ~]# ls -d test?
test1 test2 test3 testa
|
# 这个符号在linux中表示注释说明的意思,即 # 后面的内容linux忽略掉。
1
2
3
| [iyunv@localhost ~]# abc=123 #aaaaa
[iyunv@localhost ~]# echo $abc
123
|
\ 脱意字符,将后面的特殊符号(例如”*” )还原为普通字符。
1
2
3
4
5
6
| [iyunv@localhost ~]# touch \#1.txt
[iyunv@localhost ~]# ls
1,ipt #1.txt 2.txt a.txt install.log.syslog
1.ipt 1.txt anaconda-ks.cfg install.log pv
[iyunv@localhost ~]# ls \#1.txt
#1.txt
|
| 管道符,前面多次出现过,它的作用在于将符号前面命令的结果丢给符号后面的命令
1
2
| [iyunv@gz1 ~]# cat log.log |wc -l
4
|
$ 变量的前缀(获得、使用该变量时,添加该符号)
; 常常用在两条命令的中间如: ls 1.txt; ls 2.txt
~ 用户家目录
& 把一个命令丢到后台 如: sleep 10 &
> 重定向 >> 追加重定向 2> 错误重定向 2>>错误追加重定向
< 反重定向(右边文档的内容重定向给左边的命令,如 wc -l < 1.txt)
[ ]两条的命令集合 ls [12].txt 等于 ls 1.txt 2.txt 正则表达式经常用到 定义范围
|
|
|
|
|
|
|