Linux Commands Helper

💬 Your AI-powered Linux assistant

wc Command - Print Newline, Word, and Byte Counts

The wc command is used to count lines, words, and bytes in files or standard input. It is commonly used in text processing and scripting.

Syntax

wc [options] [file...]

Examples

wc file.txt

Print the number of lines, words, and bytes in file.txt.

wc -l file.txt

Print only the number of lines in file.txt.

cat file.txt | wc -w

Count the number of words in file.txt using a pipeline.

Notes

  • Use -c for byte count, -w for word count, -l for line count.
  • Can be combined with cat and grep for advanced text processing.
  • If no file is specified, wc reads from standard input.

© 2025 Linux Commands Helper. All rights reserved.

This project is under construction. Feedback and contributions are welcome.

Fazier badgeFeatured on Startup Fame