Chinaunix

标题: head命令用法 [打印本页]

作者: ningxinleng    时间: 2008-12-04 17:18
标题: head命令用法

                NAME
       head - 输出文件开头的部分
SYNOPSIS
       head [OPTION]... [FILE]...
DESCRIPTION
       Print  the  first  10 lines of each FILE to standard output.  With more
       than one FILE, precede each with a header giving the file  name.当不止要显示一个文件的时候,会在显示的每个文件前面显示文件名,例如==> filename <==
   With no FILE, or when FILE is -, read standard input.当后面没有指定文件名或者是-的时候,从标准输入读入数据显示
       Mandatory  arguments  to  long  options are mandatory for short options
       too.较长的选项的命令参数对于较短的选项也是命令的
       -c, --bytes=[-]N字符
              print the first N bytes of each  file;  with  the  leading  ‘-’,
              print all but the last N bytes of each file
       -n, --lines=[-]N行
              print  the first N lines instead of the first 10; with the lead‐\n              ing ‘-’, print all but the last N lines of each file
       -q, --quiet, --silent当显示多个文件的时候不列出文件名
              never print headers giving file names
       -v, --verbose
              always print headers giving file names
       --help display this help and exit
       --version
              output version information and exit
       N may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M
       1024*1024,  GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E,
       Z, Y.在N后面可以跟后缀的,也就是单位了,例如head -c4b filename就是列出filename的头4b长度的字符
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/85268/showart_1679722.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2