public final class Head extends Object
NAME
head - display first lines of a file
SYNOPSIS
head | |
head <args> | |
head <count> | |
head [-cq] <count> | |
head <files> | |
head <inputs> | |
head <count> <files> | |
head <count> <paths> | |
head <count> <inputs> | |
head [-cq] <count> <files> | |
head [-cq] <count> <paths> | |
head [-cq] <count> <inputs> |
See Head.Interface
for the corresponding command signature methods.
DESCRIPTION
This filter displays the first count lines or characters of each of the specified files, or of the standard input if no files are specified. If count is omitted it defaults to 10. Both line and character counts start from 1.
If more than a single file is specified, each file is preceded by a header consisting of the string "==> XXX <=="
where "XXX"
is the name of the file.
Options
The following options are supported:
-c | --chars | The count argument is in units of characters instead of
lines. Starts from 1 and includes line ending characters. | |||
-q | --suppressHeaders | Suppresses printing of headers when multiple files are being examined. |
OPERANDS
The following operands are supported:
<count> | : | long | The first count lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c option is specified). Must be a non-negative
integer or an exception is thrown. If count is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output. | ||
<paths> | : | String... | Path names of the input files to be filtered; wildcards * and ? are supported; relative paths are resolved on the basis of the current working directory. | ||
<files> | : | java.io.File... | The input files to be filtered; relative paths are not resolved (use the string paths argument to enable relative path resolving based on the current working directory). | ||
<inputs> | : | org.unix4j.io.Input... | The inputs to be filtered. | ||
<args> | : | String... | String arguments defining the options and operands for the command. Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--paths" operand have to be prefixed with the operand name (e.g. "--count" for a subsequent count operand value). | ||
<options> | : | HeadOptions | Options for the head command. |
Modifier and Type | Class and Description |
---|---|
static interface |
Head.Interface<R>
Interface defining all method signatures for the "head" command.
|
Modifier and Type | Field and Description |
---|---|
static HeadFactory |
Factory
Singleton
factory instance for the "head" command. |
static String |
NAME
The "head" command name.
|
static HeadOptionSets |
Options
|
public static final String NAME
public static final HeadOptionSets Options
public static final HeadFactory Factory
factory
instance for the "head" command.Copyright © 2024. All rights reserved.