Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


head command (displays the first part of files)

Organization of this page

Format

head [-num-lines|-n num-lines] [path-name ...]

Description

This command displays the first few lines from one or more files. The specified number of lines from the beginning of the file are output to the standard output. If no file is specified, the standard input is read. If no value is specified for the number of lines to be output, 10 lines is assumed.

Arguments

-num-lines | -n num-lines ~<decimal>((1 to 2147483647))

Specifies the number of lines from the beginning of the input file that are to be sent to the standard output. If you specify a value that is less than or equal to 0 or that is greater than 2147483647, an error message (head: line count too small: specified-value or head: line count too large: specified-value) is output.

path-name

Specifies the path name of an input file.

  • The default is the standard input.

  • Multiple files can be specified. If you specify more than one file, each file is identified at the beginning of the output from that file by a blank line (linefeed) and its file name in a header string in the following format:

    ==> file-name <==

  • When you execute the command with multiple files specified, all the files are processed. If any file fails to open, the command terminates with a return code of 1.

Return codes

Return code

Meaning

0

Normal termination

1 or greater

Error termination

Usage examples

The following shows the format of the files used in the examples below to illustrate the results of executing the head command.

The examples below illustrate the results of executing the command on the files shown above.