no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | cut [2015/06/30 15:01] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== cut ====== | ||
+ | === Examples === | ||
+ | |||
+ | == First field == | ||
+ | |||
+ | < | ||
+ | echo foo bar | cut -f 1 | ||
+ | </ | ||
+ | |||
+ | Returns ' | ||
+ | |||
+ | == First field and everything behind it == | ||
+ | |||
+ | < | ||
+ | echo foo bar | cut -d " " -f 1- | ||
+ | </ | ||
+ | |||
+ | Returns ' | ||
+ | |||
+ | == Second field == | ||
+ | |||
+ | < | ||
+ | echo foo bar | cut -d " " -f 2 | ||
+ | </ | ||
+ | |||
+ | Returns ' | ||
+ | |||
+ | == Second field only if delimiter exists == | ||
+ | |||
+ | < | ||
+ | echo foo | cut -d " " -s -f 2 | ||
+ | </ | ||
+ | |||
+ | Returns '' |