Skip to Content
gnux

-l, --lines

Print the newline counts.

An option of wcx.

Usage

wcx -l [FILE]...
wcx --lines [FILE]...

Details

ShortLongValueDefaultMeaning
-l--linesnoneprint the newline counts

Examples

Count only the lines

wcx -l access.log
wcx -wl essay.txt

Count the lines of several files, with a total

wcx -l *.go

Count several files without the total line, or force it for a single file

wcx -l --total=never *.go && wcx -l --total=always main.go

Count the entries a command produces

lsx | wcx -l

Read the list of files to count from a NUL-separated file

wcx -l --files0-from=sources.lst
find . -name '*.go' -print0 | wcx -l --files0-from=- --total=only

Fail a script when a file is missing (exit status 1)

wcx -l missing.txt || echox "exit status $?"

Count matching files in the portable gnux shell

gnux shell -c 'lsx -1 *.md | wcx -l'

Help in the terminal

gnux help wcx --lines

On this page