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, which is very reliable,The cut command has five parameters, including-C,-B, and-F, which indicate the truncation methods of "character", "Byte", and "field" respectively. 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.-Specify the range of characters to intercept 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.