2014-03-07 21:43:18 +04:00
|
|
|
# cut
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Cut out fields from STDIN or files.
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out the first sixteen characters of each line of STDIN:
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2014-03-08 05:12:41 +04:00
|
|
|
`cut -c {{1-16}}`
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out the first sixteen characters of each line of the given files:
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2014-03-08 05:12:41 +04:00
|
|
|
`cut -c {{1-16}} {{file}}`
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out everything from the 3rd character to the end of each line:
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2014-03-08 05:12:41 +04:00
|
|
|
`cut -c{{3-}}`
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out the fifth field, split on the colon character of each line:
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2014-03-08 05:12:41 +04:00
|
|
|
`cut -d'{{:}}' -f{{5}}`
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out the fields five and 10, split on the colon character of each line:
|
2014-03-07 21:43:18 +04:00
|
|
|
|
2014-03-08 05:12:41 +04:00
|
|
|
`cut -d'{{:}}' -f{{5,10}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Cut out the fields five through 10, split on the colon character of each line:
|
2014-03-08 05:12:41 +04:00
|
|
|
|
|
|
|
`cut -d'{{:}}' -f{{5-10}}`
|