"cut" Command

Learn all about cut command

HOME

cut out selected portions of each line of a file. It is used for text processing; User can use this command to extract portion of text from a file. It can be used to cut parts of a line by byte position, character and delimiter. It can also be used to cut data from file formats like CSV.

root:~# man cut
          

For example, let's say user has a file named test.txt which contains the following text:
first1  second1 third1  fourth1 five1
first2  second2 third2  fourth2 five2
first3  second3 third3  fourth3 five3
first4  second4 third4  fourth4 five4
          

In following examples, each of these words is separated by a tab character, not spaces. The tab character is the default delimiter of cut, so it will by default consider a field to be anything delimited by a tab.