Among the commands available from the linux terminal there’s also cut
, very useful for processing strings and characters in general.
The cut command is one of the oldest Unix command. That means that it is more then 40 years old. And it shows. It is important to understand that this is a Unix command and behaves in “Unix way”. For example, it uses IFS (Input Field Separators) to determine where to split fields. You can check it with set | grep IFS
. You can also set it, for example, to:
IFS=" tn"
The cut command takes a vertical slice of a file, printing only the specified columns or fields. The columns are selected using the standard IFS or one specified. Continue reading »