Online Linux Terminal Logo
OnlineLinuxTerminal
Procesamiento de textoCLI Manual

$wc

Print newline, word, and byte counts for files.

Sintaxis del comandoPOSIX Standard
wc [OPTIONS] [FILE...]
Comunidad Linux2.4k En línea

Chatea con usuarios de Linux, aprende comandos y descarga guías PDF.

Prueba en vivo en la terminal interactiva

Simulación del lado del cliente sin instalación y con respuesta inmediata.

Abrir en terminal de pantalla completa ↗
bash — terminal

Descripción general y funcionamiento

`wc` (Word Count) reads files or standard input and computes statistics including line count (`-l`), word count (`-w`), and byte count (`-c`). It is widely used in shell pipelines to count query results or filter matches (e.g., `grep ... | wc -l`).

Opciones y banderas comunes

Flag / OptionDescription
-lCount and print total newline line counts.
-wCount and print total words.
-cCount and print total bytes.
-mCount and print total characters.

Ejemplos prácticos del mundo real

#1Count total lines in a file
wc -l welcome.txt

Outputs the line count for welcome.txt.

#2Count matching error occurrences in logs
grep "error" /var/log/syslog | wc -l

Pipes grep output into wc -l to get the exact integer count.