head 輸出檔案開頭部分至標準輸出,預設顯示前 10 行。與 tail 互為首尾對應。
head [參數]… [檔案]…
| 參數 | 說明 |
|---|---|
-n, --lines=行數 | 顯示前 n 行 |
-c, --bytes=位元組 | 顯示前 n 個位元組 |
-q, --quiet | 隱藏檔名 |
-v, --verbose | 顯示檔名 |
$ head -n 5 log2014.log
$ head -c 20 log2014.log
$ head -c -32 log2014.log
$ head -n -6 log2014.log