The cut Command refers to a text truncation tool that can read content from a linux File or standard input and vertically intercept the required information columns. Cut can help us cut out the required information items, so that we can analyze the data on the server, simplify the data when the system is excluded, reduce work costs, and improve work efficiency! In addition to cut, the awk, sed, and sort commands can also be used to intercept data.
Format of cut:
Cut OPTION + [FILE] text or information to be output
Common options include:
-D: Used as the separator for cutting. The default value is space,
-F: which items are selected for output? For example, f1 indicates the first item to be cut out,
For example, it is the information of the first 10 users in/etc/passwd.
If you only want to extract the user name and the user's home directory information, you can use head/etc/passwd | cut-d:-f1, 6
-D: indicates to use the colon as the separator,-f1, 6 indicates to be separated, and then select 1st columns and 6th columns for output
Linux cut usage