1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 11:17:59 +01:00
tldr/pages/common/cut.md
2016-01-08 09:38:59 +01:00

27 lines
626 B
Markdown

# cut
> Cut out fields from STDIN or files.
- Cut out the first sixteen characters of each line of STDIN:
`cut -c {{1-16}}`
- Cut out the first sixteen characters of each line of the given files:
`cut -c {{1-16}} {{file}}`
- Cut out everything from the 3rd character to the end of each line:
`cut -c{{3-}}`
- Cut out the fifth field, split on the colon character of each line:
`cut -d'{{:}}' -f{{5}}`
- Cut out the fields five and 10, split on the colon character of each line:
`cut -d'{{:}}' -f{{5,10}}`
- Cut out the fields five through 10, split on the colon character of each line:
`cut -d'{{:}}' -f{{5-10}}`