Command: Cut
Option:-d:-f Specifies the segment divided by ": (separator)" In the first paragraph
-c Specifies the number of characters
Description: Select the command, select a piece of data we want, generally for each row to analyze the selected
[Email protected] ~]# CAT/ETC/PASSWD
Root:x:0:0:root:/root:/bin/bash
Bin:x:1:1:bin:/bin:/sbin/nologin
Daemon:x:2:2:daemon:/sbin:/sbin/nologin
......
[[email protected] ~]# cut-d:-F 4/etc/passwd//////Specify a single segment
0
1
2
....
[[email protected] ~]# cut-d:-F 3,1,4/etc/passwd////Specify multiple segments
root:0:0
Bin:1:1
Daemon:2:2
.......
////////////////////////////////////////////////////////////////////////////////////////
[[email protected] ~]# cut-c 10/etc/passwd/////Specify first character
0
:
2
.....
[[email protected] ~]# cut-c 1-10/etc/passwd//////Specify interval characters
root:x:0:0
Bin:x:1:1:
Daemon:x:2
......
//////////////////////////////////////////////
Summary cut common Options-D:-F;-C
Shell Getting Started-cut command