public final class Unix4j extends Object
Every method returns a new builder instance. For more information and a
detailed description of command building and chaining, see
Unix4jCommandBuilder
.
Modifier and Type | Method and Description |
---|---|
static Unix4jCommandBuilder |
builder()
Returns a builder to create a command or command chain.
|
static Unix4jCommandBuilder |
cat(CatOptions options,
File... files)
Reads the lines from the specified files and writes them to the
standard output; the given options define the details of the output
format.
|
static Unix4jCommandBuilder |
cat(CatOptions options,
Input... inputs)
Reads the lines from the specified inputs and writes them to the
standard output; the given options define the details of the output
format.
|
static Unix4jCommandBuilder |
cat(CatOptions options,
String... paths)
Reads the lines from the specified files and writes them to the
standard output; the given options define the details of the output
format.
|
static Unix4jCommandBuilder |
cat(File... files)
Reads the lines from the specified files and writes them to the
standard output.
|
static Unix4jCommandBuilder |
cat(Input... inputs)
Reads the lines from the specified inputs and writes them to the
standard output.
|
static Unix4jCommandBuilder |
cat(String... args)
Reads the lines from files specified as arguments and writes them to
the standard output.
|
static Unix4jCommandBuilder |
cd()
Changes the current directory to the user home directory as defined
by the execution context (usually the directory specified by the
"user.home" system property). |
static Unix4jCommandBuilder |
cd(File file)
The current working directory is changed to the given file.
|
static Unix4jCommandBuilder |
cd(String path)
The current working directory is changed to the given file.
|
static Unix4jCommandBuilder |
echo(EchoOptions options,
String... strings)
Writes any of the specified strings, separated by single blank
(
' ' ) characters to the standard output suppressing the
trailing line ending if the -n option is specified. |
static Unix4jCommandBuilder |
echo(EchoOptions options,
String string)
Writes the specified string followed by a newline character to
the standard output suppressing the trailing line ending if the
-n option is specified. |
static Unix4jCommandBuilder |
echo(String... args)
Writes any of the specified strings, separated by single blank
(
' ' ) characters to the standard output suppressing the
trailing line ending if the "-n" option is specified. |
static Unix4jCommandBuilder |
find(FindOptions options,
Date time)
Finds all files that have been created, modified or accessed before
or after the specified
time (depending on the given
-time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
Date time,
String name)
Finds all files matching the given
name that have been
created, modified or accessed before or after the specified
time (depending on the given -time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
long size)
Finds all files matching the specified file
size in or below
the user's current working directory and writes the file names to
the standard output. |
static Unix4jCommandBuilder |
find(FindOptions options,
long size,
Date time,
String name)
Finds all files matching the given
name and size and
have been created, modified or accessed before or after the specified
time (depending on the given -time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
long size,
String name)
Finds all files matching the specified file
name and
size in or below the user's current working directory and
writes the file names to the standard output. |
static Unix4jCommandBuilder |
find(FindOptions options,
String name)
Finds all files matching the specified
name in or below the
user's current working directory and writes the file names to the
standard output. |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
Date time)
Finds all files that have been created, modified or accessed before
or after the specified
time (depending on the given
-time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
Date time,
String name)
Finds all files matching the given
name that have been
created, modified or accessed before or after the specified
time (depending on the given -time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
long size)
Finds all files matching the specified file
size in or below
the directory specified by path and writes the file names
to the standard output. |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
long size,
Date time,
String name)
Finds all files matching the given
name and size and
have been created, modified or accessed before or after the specified
time (depending on the given -time... options). |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
long size,
String name)
Finds all files matching the specified file
name and
size in or below the directory specified by path
and writes the file names to the standard output. |
static Unix4jCommandBuilder |
find(FindOptions options,
String path,
String name)
Finds all files matching the specified
name in or below the
directory specified by path and writes the file names to
the standard output. |
static Unix4jCommandBuilder |
find(long size)
Finds all files matching the specified file
size in or below
the user's current working directory and writes the file names to
the standard output. |
static Unix4jCommandBuilder |
find(long size,
String name)
Finds all files matching the specified file
name and
size in or below the user's current working directory and
writes the file names to the standard output. |
static Unix4jCommandBuilder |
find(String... args)
Finds all files matching the search criteria specified by the given
arguments and writes the file names to the standard output.
|
static Unix4jCommandBuilder |
find(String path)
Finds all files in or below the directory specified by
path
and writes the file names to the standard output. |
static Unix4jCommandBuilder |
find(String path,
long size)
Finds all files matching the specified file
size in or below
the directory specified by path and writes the file names
to the standard output. |
static Unix4jCommandBuilder |
find(String path,
long size,
String name)
Finds all files matching the specified file
name and
size in or below the directory specified by path
and writes the file names to the standard output. |
static Unix4jCommandBuilder |
find(String path,
String name)
Finds all files matching the specified
name in or below the
directory specified by path and writes the file names to
the standard output. |
static Unix4jCommandBuilder |
from(Input input)
Reads from the given input object and redirects the contents into
the next command.
|
static Unix4jCommandBuilder |
from(InputStream in)
Reads from the given input stream and redirects the contents into
the next command.
|
static Unix4jCommandBuilder |
from(Iterable<? extends String> lines)
Uses the strings in the specified
input iterable as input
lines for the next command. |
static Unix4jCommandBuilder |
from(Iterator<? extends String> iterator)
Uses the strings returned by the specified iterator as input
lines for the next command.
|
static Unix4jCommandBuilder |
from(Reader reader)
Uses the given reader and redirects the read input into the next
command.
|
static Unix4jCommandBuilder |
from(Stream<? extends String> stream)
Uses the strings returned by the specified stream as input
lines for the next command.
|
static Unix4jCommandBuilder |
from(URL url)
Reads from the given URL and redirects the contents into the next
command.
|
static Unix4jCommandBuilder |
fromFile(File file)
Redirects the contents of the given file into the next command.
|
static Unix4jCommandBuilder |
fromFile(String path)
Redirects the contents of the given file into the next command.
|
static Unix4jCommandBuilder |
fromResource(Class<?> base,
String resource)
Reads from the given resource relative to the classpath and
redirects the contents into the next command.
|
static Unix4jCommandBuilder |
fromResource(String resource)
Reads from the given resource relative to the classpath and
redirects the contents into the next command.
|
static Unix4jCommandBuilder |
fromString(String string)
Uses the given string as input for the next command.
|
static Unix4jCommandBuilder |
fromStrings(String... strings)
Uses the given strings as input for the next command.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
Pattern pattern,
File... files)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
Pattern pattern,
Input... inputs)
Filters the input lines from the specified inputs and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
Pattern pattern,
String... paths)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
String regexp,
File... files)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
String regexp,
Input... inputs)
Filters the input lines from the specified inputs and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(GrepOptions options,
String regexp,
String... paths)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(Pattern pattern,
File... files)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(Pattern pattern,
Input... inputs)
Filters the lines from the specified inputs and writes the
matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(Pattern pattern,
String... paths)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(String regexp,
File... files)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
static Unix4jCommandBuilder |
grep(String regexp,
Input... inputs)
Filters the lines from the specified inputs and writes the
matching lines to the standard output.
|
static Unix4jCommandBuilder |
head(File... files)
Reads the first 10 lines from each of the specified files and writes
them to the standard output.
|
static Unix4jCommandBuilder |
head(HeadOptions options,
long count,
File... files)
Reads the first
count lines or characters from each of the
specified files and writes them to the standard output. |
static Unix4jCommandBuilder |
head(HeadOptions options,
long count,
Input... inputs)
Reads the first
count lines or characters from each of the
specified inputs and writes them to the standard output. |
static Unix4jCommandBuilder |
head(HeadOptions options,
long count,
String... paths)
Reads the first
count lines or characters from each of the
specified files and writes them to the standard output. |
static Unix4jCommandBuilder |
head(Input... inputs)
Reads the first 10 lines from each of the specified inputs and writes
them to the standard output.
|
static Unix4jCommandBuilder |
head(long count,
File... files)
Reads the first
count lines from each of the specified files
and writes them to the standard output. |
static Unix4jCommandBuilder |
head(long count,
Input... inputs)
Reads the first
count lines from each of the specified inputs
and writes them to the standard output. |
static Unix4jCommandBuilder |
head(long count,
String... paths)
Reads the first
count lines from each of the specified files
and writes them to the standard output. |
static Unix4jCommandBuilder |
ls()
Lists all files and directories in the user's current working
directory and writes them to the output.
|
static Unix4jCommandBuilder |
ls(File... files)
Prints the name of the given files and lists all files contained in
directories for every directory in
files . |
static Unix4jCommandBuilder |
ls(LsOptions options)
Lists all files and directories in the user's current working
directory and writes them to the output using the given options
specifying the details of the output format.
|
static Unix4jCommandBuilder |
ls(LsOptions options,
File... files)
Prints the name of the given files and lists all files contained in
directories for every directory in
files . |
static Unix4jCommandBuilder |
ls(LsOptions options,
String... paths)
Prints the name of the given files and lists all files contained in
directories for every directory in
files . |
static Unix4jCommandBuilder |
ls(String... args)
Prints the name of the specified files and lists all files contained
in directories for every directory in those files.
|
static Unix4jCommandBuilder |
sed(SedOptions options,
String regexp)
Executes the sed command specified by the given options or executes
the print command p if no command option has been declared.
|
static Unix4jCommandBuilder |
sed(SedOptions options,
String string1,
String string2)
Executes the sed command specified by the given options or executes
the substitute command s if no command option has been declared.
|
static Unix4jCommandBuilder |
sed(SedOptions options,
String string1,
String string2,
int... occurrence)
Executes the sed command specified by the given options or executes
the substitute command s if no command option has been declared.
|
static Unix4jCommandBuilder |
sed(String... args)
Executes the sed script specified by the given arguments and writes
the result to the standard output.
|
static Unix4jCommandBuilder |
sed(String script)
Executes the given sed script, such as "s/original/replacement/g".
|
static Unix4jCommandBuilder |
sed(String regexp,
String replacement)
Substitutes the replacement string for instances of the regexp in
the matched line.
|
static Unix4jCommandBuilder |
sed(String regexp,
String replacement,
int... occurrence)
Substitutes the replacement string for instances of the regexp in
the matched line.
|
static Unix4jCommandBuilder |
sort(Comparator<? super Line> comparator,
File... files)
Sort the lines of all the specified files together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
sort(Comparator<? super Line> comparator,
Input... inputs)
Sort the lines of all the specified inputs together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
sort(Comparator<? super Line> comparator,
String... paths)
Sort the lines of all the specified files together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
sort(File... files)
Sort the lines of all the specified files together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
sort(Input... inputs)
Sort the lines of all the specified inputs together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
Comparator<? super Line> comparator,
File... files)
Sorts, merges, or sequence checks the lines the lines of all the
specified files together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
Comparator<? super Line> comparator,
Input... inputs)
Sorts, merges, or sequence checks the lines the lines of all the
specified inputs together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
Comparator<? super Line> comparator,
String... paths)
Sorts, merges, or sequence checks the lines the lines of all the
specified files together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
File... files)
Sorts, merges, or sequence checks the lines the lines of all the
specified files together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
Input... inputs)
Sorts, merges, or sequence checks the lines the lines of all the
specified inputs together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(SortOptions options,
String... paths)
Sorts, merges, or sequence checks the lines the lines of all the
specified files together and writes the result to the standard
output.
|
static Unix4jCommandBuilder |
sort(String... args)
Sort the lines of all the specified files together and writes the
result to the standard output.
|
static Unix4jCommandBuilder |
tail(File... files)
Reads the last 10 lines from each of the specified files and writes
them to the standard output.
|
static Unix4jCommandBuilder |
tail(Input... inputs)
Reads the last 10 lines from each of the specified inputs and writes
them to the standard output.
|
static Unix4jCommandBuilder |
tail(long count,
File... files)
Reads the last
count lines from each of the specified files
and writes them to the standard output. |
static Unix4jCommandBuilder |
tail(long count,
Input... inputs)
Reads the last
count lines from each of the specified inputs
and writes them to the standard output. |
static Unix4jCommandBuilder |
tail(long count,
String... paths)
Reads the last
count lines from each of the specified files
and writes them to the standard output. |
static Unix4jCommandBuilder |
tail(String... args)
Reads the last n lines from each of the files specified and writes
them to the standard output.
|
static Unix4jCommandBuilder |
tail(TailOptions options,
long count,
File... files)
Reads the last
count lines or characters from each of the
specified files and writes them to the standard output. |
static Unix4jCommandBuilder |
tail(TailOptions options,
long count,
Input... inputs)
Reads the last
count lines or characters from each of the
specified inputs and writes them to the standard output. |
static Unix4jCommandBuilder |
tail(TailOptions options,
long count,
String... paths)
Reads the last
count lines or characters from each of the
specified files and writes them to the standard output. |
static Unix4jCommandBuilder |
uniq(File file)
Reads from the specified input
file and compares adjacent
lines, writing one copy of each input line to the standard output. |
static Unix4jCommandBuilder |
uniq(String path)
Reads the file specified by its
path and compares adjacent
lines, writing one copy of each input line to the standard output. |
static Unix4jCommandBuilder |
uniq(UniqOptions options,
File file)
Reads from the specified input
file and compares adjacent
lines, writing one copy of each input line to the standard output. |
static Unix4jCommandBuilder |
uniq(UniqOptions options,
String path)
Reads the file specified by its
path and compares adjacent
lines, writing one copy of each input line to the standard output. |
static Unix4jCommandBuilder |
use(ExecutionContextFactory contextFactory)
Returns a builder that uses the specified factory to create contexts for
command execution.
|
static Unix4jCommandBuilder |
wc(File... files)
Executes a count of lines, words and chars contained in each input
file and writes them to the standard output.
|
static Unix4jCommandBuilder |
wc(Input... inputs)
Executes a count of lines, words and chars contained in each input
and writes them to the standard output.
|
static Unix4jCommandBuilder |
wc(WcOptions options,
File... files)
Executes a one or more counts, depending on the given options, in
each of the given input files and writes them to the standard
output.
|
static Unix4jCommandBuilder |
wc(WcOptions options,
Input... inputs)
Executes a one or more counts, depending on the given options, in
each of the given inputs and writes them to the standard
output.
|
static Unix4jCommandBuilder |
wc(WcOptions options,
String[] paths)
Executes a one or more counts, depending on the given options, in
each of the given input files and writes them to the standard
output.
|
public static Unix4jCommandBuilder builder()
NoOp
command which will be replaced by the
first command joined to this builder's command chain.public static Unix4jCommandBuilder use(ExecutionContextFactory contextFactory)
NoOp
command
which will be replaced by the first command joined to this builder's
command chain.contextFactory
- the factory used to create execution contexts that are passed
to the execute method when a command is executedpublic static Unix4jCommandBuilder cat(String... args)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- String arguments defining the options and file operands for the
command. Options can be specified by acronym (with a leading dash
"-") or by long name (with two leading dashes "--"). File arguments
are expanded if wildcards are used.public static Unix4jCommandBuilder cat(File... files)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- The input files to be printed; relative paths are not resolved (use
the string path argument to enable relative path resolving based on
the current working directory).public static Unix4jCommandBuilder cat(Input... inputs)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
inputs
- The inputs to be printed.public static Unix4jCommandBuilder cat(CatOptions options, File... files)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the cat command.files
- The input files to be printed; relative paths are not resolved (use
the string path argument to enable relative path resolving based on
the current working directory).public static Unix4jCommandBuilder cat(CatOptions options, String... paths)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the cat command.paths
- Path names of the input files to be printed; wildcards * and ? are
supported; relative paths are resolved on the basis of the current
working directory.public static Unix4jCommandBuilder cat(CatOptions options, Input... inputs)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the cat command.inputs
- The inputs to be printed.public static Unix4jCommandBuilder cd()
"user.home"
system property).
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
public static Unix4jCommandBuilder cd(File file)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
file
- the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory).public static Unix4jCommandBuilder cd(String path)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder echo(String... args)
' '
) characters to the standard output suppressing the
trailing line ending if the "-n"
option is specified.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- String arguments defining the options for the command and the
strings to be written to the output. Options can be specified by
acronym (with a leading dash "-") or by long name (with two leading
dashes "--").public static Unix4jCommandBuilder echo(EchoOptions options, String string)
-n
option is specified.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the echo command.string
- A string to be written to standard output.public static Unix4jCommandBuilder echo(EchoOptions options, String... strings)
' '
) characters to the standard output suppressing the
trailing line ending if the -n
option is specified.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the echo command.strings
- Strings to be written to standard output, separated by single blank
characters.public static Unix4jCommandBuilder find(String... args)
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--name" operand have to be prefixed with the operand name.
The files names written to the output are relative paths referring
to the working directory (or -- if provided -- relative to the path
given after the "--path"
operand name).
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- 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 "--path" operand have to be prefixed with the operand name
(e.g. "--name" for subsequent path operand values).public static Unix4jCommandBuilder find(String path)
path
and writes the file names to the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder find(String path, String name)
name
in or below the
directory specified by path
and writes the file names to
the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(long size)
size
in or below
the user's current working directory and writes the file names to
the standard output. Matching files use at least size
bytes
on disk if size
is positive, or at most abs(size)
bytes if size
is zero or negative.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.public static Unix4jCommandBuilder find(String path, long size)
size
in or below
the directory specified by path
and writes the file names
to the standard output. Matching files use at least size
bytes on disk if size
is positive, or at most
abs(size)
bytes if size
is zero or negative.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.public static Unix4jCommandBuilder find(long size, String name)
name
and
size
in or below the user's current working directory and
writes the file names to the standard output. Matching files use
at least size
bytes on disk if size
is positive,
or at most abs(size)
bytes if size
is zero or
negative.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(String path, long size, String name)
name
and
size
in or below the directory specified by path
and writes the file names to the standard output. Matching files
use at least size
bytes on disk if size
is positive,
or at most abs(size)
bytes if size
is zero or
negative.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, String name)
name
in or below the
user's current working directory and writes the file names to the
standard output.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, String path, String name)
name
in or below the
directory specified by path
and writes the file names to
the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, long size)
size
in or below
the user's current working directory and writes the file names to
the standard output. Matching files use at least size
bytes
on disk if size
is positive, or at most abs(size)
bytes if size
is zero or negative.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.public static Unix4jCommandBuilder find(FindOptions options, String path, long size)
size
in or below
the directory specified by path
and writes the file names
to the standard output. Matching files use at least size
bytes on disk if size
is positive, or at most
abs(size)
bytes if size
is zero or negative.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.public static Unix4jCommandBuilder find(FindOptions options, Date time)
time
(depending on the given
-time...
options). The names of the matching files found in
or below the user's current working directory are written to the
standard output.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.public static Unix4jCommandBuilder find(FindOptions options, String path, Date time)
time
(depending on the given
-time...
options). The names of the matching files found in
or below the directory specified by path
are written to
the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.public static Unix4jCommandBuilder find(FindOptions options, long size, String name)
name
and
size
in or below the user's current working directory and
writes the file names to the standard output. Matching files use
at least size
bytes on disk if size
is positive, or
at most abs(size)
bytes if size
is zero or negative.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, String path, long size, String name)
name
and
size
in or below the directory specified by path
and writes the file names to the standard output. Matching files
use at least size
bytes on disk if size
is positive,
or at most abs(size)
bytes if size
is zero or
negative.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, Date time, String name)
name
that have been
created, modified or accessed before or after the specified
time
(depending on the given -time...
options). The
names of the matching files found in or below the user's current
working directory are written to the standard output.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, String path, Date time, String name)
name
that have been
created, modified or accessed before or after the specified
time
(depending on the given -time...
options). The
names of the matching files found in or below the directory
specified by path
are written to the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, long size, Date time, String name)
name
and size
and
have been created, modified or accessed before or after the specified
time
(depending on the given -time...
options).
Matching files use at least size
bytes on disk if
size
is positive, or at most abs(size)
bytes if
size
is zero or negative. The names of the matching files
found in or below the user's current working directory are written
to the standard output.
The files names written to the output are relative paths referring to the working directory.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder find(FindOptions options, String path, long size, Date time, String name)
name
and size
and
have been created, modified or accessed before or after the specified
time
(depending on the given -time...
options).
Matching files use at least size
bytes on disk if
size
is positive, or at most abs(size)
bytes if
size
is zero or negative. The names of the matching files
found in or below the directory specified by path
are
written to the standard output.
The files names written to the output are paths relative to the
specified path
operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the file search.path
- Starting point for the search in the directory hierarchy;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.size
- Consider only files using at least size
bytes if size
is positive, or at most abs(size)
bytes if size
is zero
or negative.time
- Consider only files that have been created, modified or accessed
before or after the specified time
operand; consider the
-time...
options for details of the comparison.name
- Name pattern to match the file name after removing the path with the
leading directories; wildcards * and ? are supported, or full
regular expressions if either of the options -regex (-r)
or
-iregex (-i)
is specified.public static Unix4jCommandBuilder fromString(String string)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
string
- the string to use as inputpublic static Unix4jCommandBuilder fromStrings(String... strings)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
strings
- the input linespublic static Unix4jCommandBuilder from(Iterable<? extends String> lines)
input
iterable as input
lines for the next command. Each string usually represents a single
line of the input; however, if any of the strings contains line
ending codes (UNIX or DOS independent from the host operating
system), it is split into multiple lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
lines
- collection with input linespublic static Unix4jCommandBuilder from(Iterator<? extends String> iterator)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
iterator
- iterator returning input linespublic static Unix4jCommandBuilder from(Stream<? extends String> stream)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
stream
- stream of input linespublic static Unix4jCommandBuilder fromFile(String path)
path > ...
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- the file to use as input; wildcards * and ? are supported; relative
paths are resolved on the basis of the current working directory.public static Unix4jCommandBuilder fromFile(File file)
file > ...
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
file
- the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory).public static Unix4jCommandBuilder fromResource(String resource)
Class.getResourceAsStream(String)
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
resource
- a path to the file to redirect to the next command. The resource needs
to be on the classpath. If the file is in the root directory, the
filename should be prefixed with a forward slash. e.g.:
"/test-file.txt"
.
If the file is in a package, then the package should be specified
prefixed with a forward slash, and with each dot "." replaced with a
forward slash. e.g.:
"/org/company/mypackage/test-file.txt"
.
A base
class operand can be provided for relative paths; see
Class.getResourceAsStream(String)
for details about
resource loading.
public static Unix4jCommandBuilder fromResource(Class<?> base, String resource)
Class.getResourceAsStream(String)
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
base
- base class for subsequent resource
operand if relative paths are used.resource
- a path to the file to redirect to the next command. The resource needs
to be on the classpath. If the file is in the root directory, the
filename should be prefixed with a forward slash. e.g.:
"/test-file.txt"
.
If the file is in a package, then the package should be specified
prefixed with a forward slash, and with each dot "." replaced with a
forward slash. e.g.:
"/org/company/mypackage/test-file.txt"
.
A base
class operand can be provided for relative paths; see
Class.getResourceAsStream(String)
for details about
resource loading.
public static Unix4jCommandBuilder from(InputStream in)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
in
- the input stream to read frompublic static Unix4jCommandBuilder from(Reader reader)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
reader
- the reader used to read the inputpublic static Unix4jCommandBuilder from(URL url)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
url
- the URL to read frompublic static Unix4jCommandBuilder from(Input input)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
input
- the input object to read frompublic static Unix4jCommandBuilder grep(String regexp, File... files)
regexp
string using case-sensitive comparison.
Line endings are not relevant for the comparison.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).public static Unix4jCommandBuilder grep(String regexp, Input... inputs)
regexp
string using case-sensitive comparison.
Line endings are not relevant for the comparison.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.inputs
- The inputs to be searched for the pattern.public static Unix4jCommandBuilder grep(Pattern pattern, File... files)
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
pattern
- Lines will be printed which match the given pattern.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).public static Unix4jCommandBuilder grep(Pattern pattern, String... paths)
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
pattern
- Lines will be printed which match the given pattern.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder grep(Pattern pattern, Input... inputs)
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
pattern
- Lines will be printed which match the given pattern.inputs
- The inputs to be searched for the pattern.public static Unix4jCommandBuilder grep(GrepOptions options, String regexp, File... files)
regexp
string; the exact comparison rules
are defined by the specified matching options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).public static Unix4jCommandBuilder grep(GrepOptions options, String regexp, String... paths)
regexp
string; the exact comparison rules
are defined by the specified matching options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder grep(GrepOptions options, String regexp, Input... inputs)
regexp
string; the exact comparison rules
are defined by the specified matching options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.inputs
- The inputs to be searched for the pattern.public static Unix4jCommandBuilder grep(GrepOptions options, Pattern pattern, File... files)
pattern
; the exact
comparison rules are defined by the specified matching
options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).public static Unix4jCommandBuilder grep(GrepOptions options, Pattern pattern, String... paths)
pattern
; the exact
comparison rules are defined by the specified matching
options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder grep(GrepOptions options, Pattern pattern, Input... inputs)
pattern
; the exact
comparison rules are defined by the specified matching
options
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.inputs
- The inputs to be searched for the pattern.public static Unix4jCommandBuilder head(File... files)
"==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- 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).public static Unix4jCommandBuilder head(Input... inputs)
"==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
inputs
- The inputs to be filtered.public static Unix4jCommandBuilder head(long count, File... files)
count
lines from each of the specified files
and writes them to the standard output. 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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- 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.files
- 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).public static Unix4jCommandBuilder head(long count, String... paths)
count
lines from each of the specified files
and writes them to the standard output. 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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- 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
- 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.public static Unix4jCommandBuilder head(long count, Input... inputs)
count
lines from each of the specified inputs
and writes them to the standard output. If more than a single input
is specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- 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.inputs
- The inputs to be filtered.public static Unix4jCommandBuilder head(HeadOptions options, long count, File... files)
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the head command.count
- 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.files
- 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).public static Unix4jCommandBuilder head(HeadOptions options, long count, String... paths)
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the head command.count
- 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
- 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.public static Unix4jCommandBuilder head(HeadOptions options, long count, Input... inputs)
count
lines or characters from each of the
specified inputs and writes them to the standard output. If more than
a single input is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the head command.count
- 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.inputs
- The inputs to be filtered.public static Unix4jCommandBuilder ls()
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
public static Unix4jCommandBuilder ls(String... args)
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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- 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).public static Unix4jCommandBuilder ls(File... files)
files
.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).public static Unix4jCommandBuilder ls(LsOptions options)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the output format.public static Unix4jCommandBuilder ls(LsOptions options, File... files)
files
. The given options
define the details of the output format.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the output format.files
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).public static Unix4jCommandBuilder ls(LsOptions options, String... paths)
files
. The given options
define the details of the output format.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the output format.paths
- The files or directories used as starting point for the listing;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder sed(String... args)
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--script" operand have to be prefixed with the operand name.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- 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 "--script" operand have to be prefixed with the operand name
(e.g. "--occurrence" for subsequent occurrence indices).public static Unix4jCommandBuilder sed(String script)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
script
- Sed script as one string, such as "s/original/replacement/g".public static Unix4jCommandBuilder sed(String regexp, String replacement)
The characters "$0" appearing in the replacement are replaced by the line matching the regexp. The characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
A line can be split by substituting a newline ('\n') into it.
A substitution is considered to have been performed even if the replacement string is identical to the string that it replaces.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
regexp
- Regular expression matched against a line.replacement
- Replacement string for substitute command. The characters "$0"
appearing in the replacement are replaced by the line matching
the regexp. The characters "$n", where n is a digit other than zero,
are replaced by the text matched by the corresponding backreference
expression (aka group). The special meaning of "$n" in this context
can be suppressed by preceding it by a backslash.public static Unix4jCommandBuilder sed(String regexp, String replacement, int... occurrence)
The characters "$0" appearing in the replacement are replaced by the line matching the regexp. The characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
A line can be split by substituting a newline ('\n') into it.
A substitution is considered to have been performed even if the replacement string is identical to the string that it replaces.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
regexp
- Regular expression matched against a line.replacement
- Replacement string for substitute command. The characters "$0"
appearing in the replacement are replaced by the line matching
the regexp. The characters "$n", where n is a digit other than zero,
are replaced by the text matched by the corresponding backreference
expression (aka group). The special meaning of "$n" in this context
can be suppressed by preceding it by a backslash.occurrence
- Substitute for the given occurrences only of the regexp found within
the matched string; the occurrence indices are one-based. If empty
or omitted, all occurrences are substituted.
(This operand only applies to the substitute command and is ignored by all other commands).
public static Unix4jCommandBuilder sed(SedOptions options, String regexp)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Sed options and commandsregexp
- Regular expression matched against a line.public static Unix4jCommandBuilder sed(SedOptions options, String string1, String string2)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Sed options and commandsstring1
- Regular expression matched against a line for all commands except
for command y where string1 contains the source characters for the
translation.string2
- Replacement string for substitute command s; appended, inserted or
changed text for a, i and c command; destination characters for
translate command y; ignored by all other commands.
If string2 is a replacement string for the substitute command: the characters "$0" appearing in the replacement are replaced by the line matching the regexp; the characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
(This operand only applies to the commands s, a, i, c and y and is ignored by all other commands).
public static Unix4jCommandBuilder sed(SedOptions options, String string1, String string2, int... occurrence)
The string1 operand usually contains the regular expression matched against a line for all commands except for command y where string1 contains the source characters for the translation.
The string2 operand contains the replacement string for the substitute command s. It contains the appended, inserted or changed text for the commands a, i and c, respectively, and the destination characters for the translate command y. All other commands ignore the string2 operand.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Sed options and commandsstring1
- Regular expression matched against a line for all commands except
for command y where string1 contains the source characters for the
translation.string2
- Replacement string for substitute command s; appended, inserted or
changed text for a, i and c command; destination characters for
translate command y; ignored by all other commands.
If string2 is a replacement string for the substitute command: the characters "$0" appearing in the replacement are replaced by the line matching the regexp; the characters "$n", where n is a digit other than zero, are replaced by the text matched by the corresponding backreference expression (aka group). The special meaning of "$n" in this context can be suppressed by preceding it by a backslash.
(This operand only applies to the commands s, a, i, c and y and is ignored by all other commands).
occurrence
- Substitute for the given occurrences only of the regexp found within
the matched string; the occurrence indices are one-based. If empty
or omitted, all occurrences are substituted.
(This operand only applies to the substitute command and is ignored by all other commands).
public static Unix4jCommandBuilder sort(String... args)
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.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- 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. "--comparator" for a subsequent comparator operand value).public static Unix4jCommandBuilder sort(File... files)
Comparisons are based on the entire line without line ending. The collating sequence of the current locale is used to perform the comparisons.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- The files to be sorted or merged; relative paths are not resolved
(use the string paths argument to enable relative path resolving
based on the current working directory).public static Unix4jCommandBuilder sort(Input... inputs)
Comparisons are based on the entire line without line ending. The collating sequence of the current locale is used to perform the comparisons.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different inputs, the index of the input in the arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
inputs
- The inputs to be sorted or merged.public static Unix4jCommandBuilder sort(Comparator<? super Line> comparator, File... files)
Line comparisons are based on the specified comparator
.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
comparator
- The comparator to use for the line comparisons.files
- The files to be sorted or merged; relative paths are not resolved
(use the string paths argument to enable relative path resolving
based on the current working directory).public static Unix4jCommandBuilder sort(Comparator<? super Line> comparator, String... paths)
Line comparisons are based on the specified comparator
.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
comparator
- The comparator to use for the line comparisons.paths
- Path names of the files to be sorted, merged, or checked; wildcards *
and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder sort(Comparator<? super Line> comparator, Input... inputs)
Line comparisons are based on the specified comparator
.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different inputs, the index of the input in the arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
comparator
- The comparator to use for the line comparisons.inputs
- The inputs to be sorted or merged.public static Unix4jCommandBuilder sort(SortOptions options, File... files)
Comparisons are based on the entire line without line ending. The collating sequence of the current locale is used to perform the comparisons.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.files
- The files to be sorted or merged; relative paths are not resolved
(use the string paths argument to enable relative path resolving
based on the current working directory).public static Unix4jCommandBuilder sort(SortOptions options, String... paths)
Comparisons are based on the entire line without line ending. The collating sequence of the current locale is used to perform the comparisons.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.paths
- Path names of the files to be sorted, merged, or checked; wildcards *
and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder sort(SortOptions options, Input... inputs)
Comparisons are based on the entire line without line ending. The collating sequence of the current locale is used to perform the comparisons.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different inputs, the index of the input in the arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.inputs
- The inputs to be sorted or merged.public static Unix4jCommandBuilder sort(SortOptions options, Comparator<? super Line> comparator, File... files)
Line comparisons are based on the specified comparator
.
All comparison related options except for --reverse
are
ignored.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.comparator
- The comparator to use for the line comparisons.files
- The files to be sorted or merged; relative paths are not resolved
(use the string paths argument to enable relative path resolving
based on the current working directory).public static Unix4jCommandBuilder sort(SortOptions options, Comparator<? super Line> comparator, String... paths)
Line comparisons are based on the specified comparator
.
All comparison related options except for --reverse
are
ignored.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different input files, the index of the file in the input arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.comparator
- The comparator to use for the line comparisons.paths
- Path names of the files to be sorted, merged, or checked; wildcards *
and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder sort(SortOptions options, Comparator<? super Line> comparator, Input... inputs)
Line comparisons are based on the specified comparator
.
All comparison related options except for --reverse
are
ignored.
The sort algorithm used is guaranteed to be stable: lines considered equal will not be reordered as a result of the sort. If two lines originate from different inputs, the index of the input in the arguments list defines the ordering of the lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options for the sort command.comparator
- The comparator to use for the line comparisons.inputs
- The inputs to be sorted or merged.public static Unix4jCommandBuilder tail(String... args)
"==> XXX <=="
where "XXX"
is the name
of the file.
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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
args
- 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).public static Unix4jCommandBuilder tail(File... files)
"==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- 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).public static Unix4jCommandBuilder tail(Input... inputs)
"==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
inputs
- The inputs to be filtered.public static Unix4jCommandBuilder tail(long count, File... files)
count
lines from each of the specified files
and writes them to the standard output. 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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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.files
- 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).public static Unix4jCommandBuilder tail(long count, String... paths)
count
lines from each of the specified files
and writes them to the standard output. 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.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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
- 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.public static Unix4jCommandBuilder tail(long count, Input... inputs)
count
lines from each of the specified inputs
and writes them to the standard output. If more than a single input
is specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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.inputs
- The inputs to be filtered.public static Unix4jCommandBuilder tail(TailOptions options, long count, File... files)
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the tail command.count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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.files
- 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).public static Unix4jCommandBuilder tail(TailOptions options, long count, String... paths)
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the tail command.count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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
- 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.public static Unix4jCommandBuilder tail(TailOptions options, long count, Input... inputs)
count
lines or characters from each of the
specified inputs and writes them to the standard output. If more than
a single input is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- Options for the tail command.count
- The last count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified, and offset from start
instead of end with -s
option). 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.inputs
- The inputs to be filtered.public static Unix4jCommandBuilder uniq(File file)
file
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated lines in the input are not detected if they are not adjacent (see --global or -g option); sorted input lines always result in unique output lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
file
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).public static Unix4jCommandBuilder uniq(String path)
path
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated lines in the input are not detected if they are not adjacent (see --global or -g option); sorted input lines always result in unique output lines.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
path
- The files or directories used as starting point for the listing;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder uniq(UniqOptions options, File file)
file
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated non-adjacent lines in the input are only detected with the --global or -g option. In other words, unique output lines are guaranteed only if either (a) the --global or -g option is specified, or (b) the input lines are sorted.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the uniqueness details for the output lines.file
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).public static Unix4jCommandBuilder uniq(UniqOptions options, String path)
path
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated non-adjacent lines in the input are only detected with the --global or -g option. In other words, unique output lines are guaranteed only if either (a) the --global or -g option is specified, or (b) the input lines are sorted.
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining the uniqueness details for the output lines.path
- The files or directories used as starting point for the listing;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.public static Unix4jCommandBuilder wc(File... files)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
files
- The input files; relative paths are not resolved (use the string
paths argument to enable relative path resolving based on the
current working directory).public static Unix4jCommandBuilder wc(Input... inputs)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
inputs
- The inputs.public static Unix4jCommandBuilder wc(WcOptions options, File... files)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining command behavior.files
- The input files; relative paths are not resolved (use the string
paths argument to enable relative path resolving based on the
current working directory).public static Unix4jCommandBuilder wc(WcOptions options, String[] paths)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining command behavior.paths
- Path names of the input files; wildcards * and ? are supported;
relative paths are resolved on the basis of the current working
directory.public static Unix4jCommandBuilder wc(WcOptions options, Input... inputs)
Note that the method returns the command builder to allow for command
chaining. The command itself is returned by the build()
method
of the returned builder (see Unix4jCommandBuilder
for more information).
options
- The options defining command behavior.inputs
- The inputs.Copyright © 2024. All rights reserved.