Linux wc command

If you’re interested in finding the word count or lines of a file in your Linux environment you can use the wc command. This is a handy command especially for monitoring extremely large files or system logs. In this article, we will show you the basic usage of the Linux wc command.

Basic Linux wc command usage

This will provide an output of 11 22 33 file.txt where

11 – Amount of lines
22 – Amount of words
33 – Amount of characters

wc file.txt

Find the number of lines or words of a file

If you wish to find out separate information, like just the lines or words you can use

wc -l file.txt # lines
wc -w file.txt # words
wc -m file.txt # characters
  • 0 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...

Linux su command

The su command is most commonly used to switch to another user. You will then be able to run...

Linux ln command

When you want to create “shortcuts” to different files in a Linux system you have to create a...

Powered by WHMCompleteSolution