From 52de7cfc4f942f436c028514eae1fd3178e5fc90 Mon Sep 17 00:00:00 2001 From: Marshall Yount Date: Fri, 7 Mar 2014 11:43:18 -0600 Subject: [PATCH] add support for cut command --- pages/common/cut.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/common/cut.md diff --git a/pages/common/cut.md b/pages/common/cut.md new file mode 100644 index 0000000000..df5ccc97be --- /dev/null +++ b/pages/common/cut.md @@ -0,0 +1,23 @@ +# cut + +> Cut out fields from STDIN + +- Cut out the first sixteen characters of each line of STDIN + +`cut -c 1-16` + +- Cut out the fifth field, split on the colon character of each line in `file` + +`cut -d':' -f5 file` + +- Cut out the fields five and 10, split on the colon character of each line in `file` + +`cut -d':' -f5,10 file` + +- Cut out the fields five through 10, split on the colon character of each line in `file` + +`cut -d':' -f5-10 file` + + Cut out everything from the 3rd character to the end of each line + +`cut -c3- test.txt`