The Linux Cut command shows each line of text from the beginning to the NUM1 to num2.
Grammar
Cut [-bn] [File]cut [-c] [file]cut [-DF] [file]
Instructions for use:
The cut command cuts bytes, characters, and fields from each line of the file and writes those bytes, characters, and fields to standard output.
If you do not specify a file parameter, the Cut command reads standard input. One of the-B,-C, or-f flags must be specified.
Parameters:
-B: Split in bytes. These byte locations will ignore multibyte character boundaries unless the-n flag is also specified. -C: Split in characters. -D: Custom delimiter, default is tab. -F: Used with-D to specify which area to display. -N: Cancels splitting multibyte characters. Used only with the-B flag. If the last byte of a character falls within the range indicated by the List parameter of the-B flag, the character is written out;
Instance
When you execute the WHO command, you will output something like this:
W.H.O.
rocrocket:0 2009-01-08 11:07rocrocket pts/0 2009-01-08 11:23 (: 0.0)rocrocket pts/1 2009-01-08 14:15 (: 0.0)
If we want to extract the 3rd byte of each row, that's it:
Who|cut-b 3
Cc
Transferred from: http://www.runoob.com/linux/linux-comm-cut.html
Linux text Segment cropping command cut (GO)