HOME

TheInfoList



OR:

is a program on
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s used to display the beginning of a text file or piped data.


Syntax

The command
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
is: head ptions By default, will print the first 10 lines of its input to the
standard output Standard may refer to: Symbols * Colours, standards and guidons, kinds of military signs * Standard (emblem), a type of a large symbol or emblem used for identification Norms, conventions or requirements * Standard (metrology), an object t ...
.


Option flags


Other command

Many early versions of Unix and Plan 9 did not have this command, and documentation and books used sed instead: sed 5q ''filename'' The example prints every line (implicit) and quits after the fifth. Equivalently, awk may be used to print the first five lines in a file: awk 'NR < 6' ''filename'' However, neither sed nor awk were available in early versions of
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
, which were based on Version 6 Unix, and included head.


Implementations

A head command is also part of
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
's ''MSX-DOS2 Tools'' for
MSX-DOS MSX-DOS is a discontinued disk operating system developed by Microsoft's Japan subsidiary for the 8-bit home computer standard MSX, and is a cross between MS-DOS v1.25 and CP/M-80 v2.2. MSX-DOS MSX-DOS and the extended BASIC with 3½-in ...
version 2. The command has also been ported to the
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system developed by IBM for IBM Power Systems. It was originally released in 1988 as OS/400, as the sole operating system of the IBM AS/400 line of systems. It was renamed to i5/OS in 2 ...
operating system.


See also

*
tail (Unix) is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data. Implementations The version of bundled in GNU coreutils was written by Paul Rubin, David MacKenzie, Ian Lance T ...
*
dd (Unix) dd is shell command for reading, writing and converting file data. Originally developed for Unix, it has been implemented on many other environments including Unix-like operating systems, Windows, Plan 9 and Inferno. The command can be used ...
*
List of Unix commands This is a list of the shell commands of the most recent version of the Portable Operating System Interface (POSIX) IEEE Std 1003.1-2024 which is part of the Single UNIX Specification (SUS). These commands are implemented in many shells on moder ...


References


External links


head
manual page from
GNU GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
coreutils The GNU Core Utilities or coreutils is a collection of GNU software that implements many standard, Unix-based shell commands. The utilities generally provide POSIX compliant interface when the environment variable is set, but otherwise offers ...
.
FreeBSD documentation for head
{{Core Utilities commands Unix text processing utilities Unix SUS2008 utilities IBM i Qshell commands