Online Linux Terminal Logo
OnlineLinuxTerminal
TextverarbeitungCLI Manual

$wc

Print newline, word, and byte counts for files.

BefehlssyntaxPOSIX Standard
wc [OPTIONS] [FILE...]
Linux-Community2.4k Online

Tausche dich mit Linux-Nutzern aus, lerne Befehle und lade PDF-Cheatsheets herunter.

Live im interaktiven Terminal ausprobieren

Client-seitige Simulation ohne Installation mit sofortigem Feedback.

Im Vollbild-Terminal öffnen ↗
bash — terminal

Überblick & Funktionsweise

`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`).

Wichtige Optionen und Flags

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

Praktische Anwendungsbeispiele

#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.