1. 特殊符号:
* n个字符
? 一个字符
# 注释字符
\ 脱意符号,与' '类似
| 管道符
2. cut命令
cut命令: -d(分隔符) -f(指定段号) -c(指定第几个字符)
[root@panyu001 test]# cat /etc/passwd |head -2 |cut -d ":" -f 1,2,3,4 #指定以冒号为分割符号显示1,2,3,4段
root:x:0:0
bin:x:1:1
[root@panyu001 test]# cat /etc/passwd |head -2 |cut -c 3 # 前两行第3个字符
o
n
[root@panyu001 test]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin