From 195d8d34f98069cb090146166586fb149d3579ea Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 16 Jul 2014 22:50:37 +0800 Subject: [PATCH] add page for head in mac and linux --- pages/linux/head.md | 19 +++++++++++++++++++ pages/osx/head.md | 11 +++++++++++ 2 files changed, 30 insertions(+) create mode 100644 pages/linux/head.md create mode 100644 pages/osx/head.md diff --git a/pages/linux/head.md b/pages/linux/head.md new file mode 100644 index 000000000..192145d47 --- /dev/null +++ b/pages/linux/head.md @@ -0,0 +1,19 @@ +# head + +> Output the first part of files + +- Output the first few lines of a file + +`head -n {{count of lines}} {{filename}}` + +- Output the first few bytes of a file + +`head -c {{size in kilobytes}} {{filename}}` + +- Output everything but the last few lines of a file + +`head -n -{{count of lines}} {{filename}}` + +- Output everything but the last few bytes of a file + +`head -c -{{size in kilobytes}} {{filename}}` diff --git a/pages/osx/head.md b/pages/osx/head.md new file mode 100644 index 000000000..f748591ca --- /dev/null +++ b/pages/osx/head.md @@ -0,0 +1,11 @@ +# head + +> Output the first part of files + +- Output the first few lines of a file + +`head -n {{count of lines}} {{filename}}` + +- Output the first few bytes of a file + +`head -c {{number in kilobytes}} {{filename}}`