public final class Wc extends Object
NAME
wc - word, line, and byte or character count
SYNOPSIS
wc | |
wc <args> | |
wc <files> | |
wc <inputs> | |
wc [-lwm] | |
wc [-lwm] <files> | |
wc [-lwm] <paths> | |
wc [-lwm] <inputs> |
See Wc.Interface
for the corresponding command signature methods.
DESCRIPTION
The wc utility reads from the input and, by default, writes thenumber of lines, words, and characters to the output. If more than one input file is specified, a line of cumulative counts for all the files is displayed ona separate line after the output for the last file.
The wc utility considers a word to be a non-zero-length string of charactersdelimited by white space. White space characters are the set of characters for which Character.isWhitespace(char)
returns true.
When any option is specified, wc reports only the information requested bythe specified options.
If only one count type is requested, the count is outputted as an integer. Ifmore than one count is requested, a fixed width formatting is used, with thecounts being right aligned. The width of each field is equal to the width ofthe widest field (count) plus two characters.
Options
The following options are supported:
-l | --lines | Executes a count of lines and writes this count to the output. | |||
-w | --words | Executes a count of words and writes this count to the output. A
word is a non-zero-length string of characters delimited by white
space as defined by Character.isWhitespace(char) . | |||
-m | --chars | Executes a count of chars and writes this count to the output. |
OPERANDS
The following operands are supported:
<paths> | : | String[] | Path names of the input files; wildcards * and ? are supported; relative paths are resolved on the basis of the current working directory. | ||
<files> | : | java.io.File... | The input files; relative paths are not resolved (use the string paths argument to enable relative path resolving based on the current working directory). | ||
<inputs> | : | org.unix4j.io.Input... | The inputs. | ||
<args> | : | String... | String arguments defining the options and operands for the command. Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--paths" operand have to be prefixed with the operand name. | ||
<options> | : | WcOptions | The options defining command behavior. |
Modifier and Type | Class and Description |
---|---|
static interface |
Wc.Interface<R>
Interface defining all method signatures for the "wc" command.
|
public static final String NAME
public static final WcOptionSets Options
l
, w
, m
.
-l | --lines | Executes a count of lines and writes this count to the output. | |||
-w | --words | Executes a count of words and writes this count to the output. A
word is a non-zero-length string of characters delimited by white
space as defined by Character.isWhitespace(char) . | |||
-m | --chars | Executes a count of chars and writes this count to the output. |
Copyright © 2024. All rights reserved.