Shell Special Symbol Cut command
* * indicates wildcard characters
?? represents an arbitrary character
# #号注释字符, the annotated content will not take effect
The \ \ symbol denotes the caret character, leaving the special symbol out of the original special usage
Cut for segmentation
Cut-d Separator-F filter Field/File
-d Specifies the delimiter, separated by commas, to display multiple fields, such as 3,6
-f Specifies the number of characters in the column
-C cut interval characters, such as 3-6-interval characters
[[email protected] tmp]# cat passwd |head -5 |cut -d ":" -f 1 cut截取第一段内容rootbindaemonadmlp[[email protected] tmp]# cat passwd |head -5 |cut -d ":" -f 1,2 cut截取第1、2段内容root:xbin:xdaemon:xadm:xlp:x[[email protected] tmp]# cat passwd |head -5 |cut -d ":" -f 1-3 cut截取1到3段内容root:x:0bin:x:1daemon:x:2adm:x:3lp:x:4[[email protected] tmp]# cat passwd |head -5 |cut -d ":" -f 1,3,6 cut截取1、3、6段内容root:0:/rootbin:1:/bindaemon:2:/sbinadm:3:/var/admlp:4:/var/spool/lpd
Sort_wc_uniq command
Tee_tr_split command
Shell special symbol under
Common commands in the shell