diff --git a/pages/linux/head.md b/pages/linux/head.md new file mode 100644 index 0000000000..192145d477 --- /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 0000000000..f748591ca6 --- /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}}`