Loading...
Shell ScriptUncategorized

Cut Command

The cut command in UNIX or Linux is used to select sections of text from each line of files. It is used to select fields or columns from a line by specifying a delimiter or to select a portion of text by specify the range or characters. Basically the cut command slices a line and extracts the text.

The most commonly used options in cut commands are as follows.

Option    Description
-c             Cuts the input file using list of characters specified by this option
-f             Cuts the input file using list of  field. The default field to be used TAB.
-d             Specifies a delimiter to use as a field. As mentioned previously default field is TAB and this                  option overwrites this default behaviour.

In the following cut command examples

Leave a Reply

Your email address will not be published. Required fields are marked *