Docu review done: Mon 03 Jul 2023 17:08:49 CEST

Table of Content

Commands for cut

CommandDescription
-f [start]-cuts from [start] till EOL
-f [start]-[end]cuts from [start] till [end]
-f [colnrX],[colnrY]prints only column X and column Y and dont ask Y 490

Samples

Content of the testfile:

$ iamroot@localhost: ~/ cat ./cuttest
Column1 Column2 Column3 Column4 Column5
Row1C1 Row1C2 Row1C3 Row1C4 Row1C5
Row2C1 Row2C2 Row2C3 Row2C4 Row2C5
Row3C1 Row3C2 Row3C3 Row3C4 Row3C5
Row4C1 Row4C2 Row4C3 Row4C4 Row4C5
Row5C1 Row5C2 Row5C3 Row5C4 Row5C5

Sample for x and y

$ iamroot@localhost: ~/ cat ./cuttest | cut -d\  -f 1,5
Column1 Column5
Row1C1 Row1C5
Row2C1 Row2C5
Row3C1 Row3C5
Row4C1 Row4C5
Row5C1 Row5C5

Sample for start till end

$ iamroot@localhost: ~/ cat ./cuttest | cut -d\  -f 2-4
Column2 Column3 Column4
Row1C2 Row1C3 Row1C4
Row2C2 Row2C3 Row2C4
Row3C2 Row3C3 Row3C4
Row4C2 Row4C3 Row4C4
Row5C2 Row5C3 Row5C4

Sample for start till EOL

$ iamroot@localhost: ~/ cat ./cuttest | cut -d\  -f 4-
Column4 Column5
Row1C4 Row1C5
Row2C4 Row2C5
Row3C4 Row3C5
Row4C4 Row4C5
Row5C4 Row5C5