Cut Command in Linux
Cut Command in Linux
Cut Command
- This linux command is used to display or cut the specific column(s) or range of columns from the input text file.
Syntax
cut -c<number> filename
Example
cut -c5 g1.txt
Here, 5th column will be cut and displayed in the terminal.
Options
-c1,5 -> cut only column1 and 5.
-c1-5 -> cut columns from 1 to 5.
Example 1 - Cut Specific Column (Cut 3rd Column from file f1)
Example 2 - Cut Specific Columns (Cut 3rd and 6th Column from file f1)
Example 3 - Cut range of Columns (Cut 3rd and 6th Column from file f1)
Comments
Post a Comment