1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-19 09:55:26 +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

451 B

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}}