Head (Unix)

Head (Unix)

head is a program on Unix and Unix-like systems used to display the first few lines of a text file or piped data. The command syntax is:

head [options] <file_name>

By default, head will print the first 10 lines of its input to the standard output. The number of lines printed may be changed with a command line option. The following example shows the first 20 lines of "filename":

head -n 20 "filename"

This displays the first 5 lines of all files starting with "foo":

head -n 5 "foo*"

Some versions omit the n and just let you say -5.

Flags

-c Copy first x number of bytes.

Other

Many early versions of Unix did not have this command, and so documentation and books had sed do this job:

sed 5q "foo"

This says to print 5 lines, then quit.

ee also

*tail
*List of Unix programs

External links

* [http://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html head] manual page from GNU coreutils.
* [http://www.freebsd.org/cgi/man.cgi?query=head&apropos=0&sektion=0&manpath=FreeBSD+5.3-RELEASE+and+Ports&format=html FreeBSD documentation for head]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Head (Unix) — head est une commande UNIX qui permet d afficher les premières lignes de texte d un fichier ou de l entrée standard. La syntaxe de cette commande est la suivante : head [options] <fichier> Par défaut, head affiche les 10 premières… …   Wikipédia en Français

  • Head (Unix) — Saltar a navegación, búsqueda head (que significa cabeza en inglés) es un programa de los sistemas tipo Unix que muestra las primeras líneas de uno o más archivos de texto. head imprimirá por defecto a la salida estándar las primeras diez líneas… …   Wikipedia Español

  • head (Unix) — head (englisch „Kopf“) ist ein Programm für Unix und unixähnliche Betriebssysteme zur Ausgabe der ersten Zeilen einer Datei. Im Gegensatz zu einem Texteditor ist der Benutzer jedoch mit head nicht in der Lage Änderungen an der Datei vorzunehmen.… …   Deutsch Wikipedia

  • head (Unix) — head (que significa cabeza en inglés) es un programa de los sistemas tipo Unix que muestra las primeras líneas de uno o más archivos de texto. head imprimirá por defecto a la salida estándar las primeras diez líneas de sus datos de entrada. Tanto …   Wikipedia Español

  • Head (Unix) — head утилита в head /var/log/messages Изменить количество выводимых строк можно указав ключ n <количество строк>: head n 20 /var/log/messages или <количество строк>: head 20 /var/log/messages Зачастую используется в качестве элемента… …   Википедия

  • head (Unix) — Pour les articles homonymes, voir Head. head est une commande UNIX qui permet d afficher les premières lignes de texte d un fichier ou de l entrée standard. La syntaxe de cette commande est la suivante : head [options] <fichier> Par… …   Wikipédia en Français

  • head (Unix) — У этого термина существуют и другие значения, см. Head. head  утилита в UNIX и UNIX подобных системах, выводящая первые n строк из файла, по умолчанию n равно 10: head /var/log/messages Изменить количество выводимых строк можно указав ключ n …   Википедия

  • Head — es un término inglés que significa cabeza . En español es utilizado para referirse a: Un programa informático típico de los sistemas Unix: head (Unix). En el ámbito de la informática también se utiliza en las tecnologías HTML, HTTP o CVS. El… …   Wikipedia Español

  • Head — Head: Сообщества, компании и марки High Energy Astrophysics Division  подразделение Американского астрономического общества. Head  компания производитель спортивного инвентаря. Компьютерные технологии head (Unix)  утилита Unix. См …   Википедия

  • Head (disambiguation) — In anatomy, the head of an animal is the rostral part (from anatomical position) that usually comprises the brain, eyes, ears, nose, and mouth.Metaphorically, Head may refer to a person who is a leader, supervisor or the like, such as the head of …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”