Recently, I started to get started with some shell commands because of compiling some files. It seems amazing and the usage is quite large. So I made some notes and the command sequence may be messy, the function is not fully functional.
1. Cut command
The cut command is used to intercept a certain segment of a character. The cut command has five parameters, among which-C,-B, and-F indicate "character ", "Byte" and "field" interception methods. Can only one of the three interception methods be used?
Here are two usage examples:
(1): Echo Hello, world | cut-C 8-12. In this usage, the truncation is based on the character position, and the range of characters to be truncated is specified after-C.
(2): Echo Hello, world | cut-F 1-d ',',-d Indicates 'delimiter ', that is, the separator, for example, in this example, it can be ''(Space), ',' (comma), and the number after-F indicates the part of the parts separated by delimiters.