the cut command in linux os is used to select selection of text from each line of files.it is also used to select fields or columns from a line by specifying a delimiter,or selecting a portion of text by giving the range of charaters from the file.basically the cut command slices a line,and extracts the text.
$cut [option] [file_name]
Sr.No |
Options |
Descriptions |
---|---|---|
01 |
-c |
to specify the charater position |
02 |
-f |
to specify the field position |
03 |
-d |
to specify the delimiter |
Example
$cut -c1-5 file1.txt
it will print the charaters from first position to fifth position from each line of sample file.(range can be specified with starting position & ending position by hyphen[-]sign.