1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-09 07:13:18 +02:00
tldr/pages/common/cut.md
Pete Riches 3fc7bd3d7d
cut: use --delimiter with --fields (#9503)
The `--delimiter`option only applies when separating fields.
I have changed the second example to use `--fields` instead of `--characters`, which threw an error.
2022-11-08 14:31:49 +00:00

16 lines
451 B
Markdown

# cut
> Cut out fields from stdin or files.
> More information: <https://www.gnu.org/software/coreutils/cut>.
- Print a specific character/field range of each line:
`{{command}} | cut --{{characters|fields}}={{1|1,10|1-10|1-|-10}}`
- Print a range of each line with a specific delimiter:
`{{command}} | cut --delimiter="{{,}}" --{{fields}}={{1}}`
- Print a range of each line of the specific file:
`cut --{{characters}}={{1}} {{path/to/file}}`