From dfa4d63597863d4366f8e7a98723315ee23878ab Mon Sep 17 00:00:00 2001 From: Romain Prieto Date: Sat, 8 Mar 2014 12:12:41 +1100 Subject: [PATCH] cut: fix token syntax + group by characters/fields --- pages/common/cut.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pages/common/cut.md b/pages/common/cut.md index df5ccc97be..72d8ccfcb9 100644 --- a/pages/common/cut.md +++ b/pages/common/cut.md @@ -1,23 +1,27 @@ # cut -> Cut out fields from STDIN +> Cut out fields from STDIN or files - Cut out the first sixteen characters of each line of STDIN -`cut -c 1-16` +`cut -c {{1-16}}` -- Cut out the fifth field, split on the colon character of each line in `file` +- Cut out the first sixteen characters of each line of the given files -`cut -d':' -f5 file` +`cut -c {{1-16}} {{file}}` -- Cut out the fields five and 10, split on the colon character of each line in `file` +- Cut out everything from the 3rd character to the end of each line -`cut -d':' -f5,10 file` +`cut -c{{3-}}` -- Cut out the fields five through 10, split on the colon character of each line in `file` +- Cut out the fifth field, split on the colon character of each line -`cut -d':' -f5-10 file` +`cut -d'{{:}}' -f{{5}}` - Cut out everything from the 3rd character to the end of each line +- Cut out the fields five and 10, split on the colon character of each line -`cut -c3- test.txt` +`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}}`