cut Linux Commands
What is Linux cut Command?
cut COMMAND:cut command is used to cut out selected fields of each line of a file. The cut command uses delimiters to determine where to split fields.
||Specifies character positions.
||Specifies byte positions.
||Specifies the delimiters and fields.
Lets create a file file1.txt and let it have the following data:
|Data in file1.txt|
|This is, an example program,for cut command. |
cut -c1-3 text.txt
Cut the first three letters from the above line.
cut -d, -f1,2 text.txt
This is, an example program
The above command is used to split the fields using delimiter and cut the first two fields.