wc command in Linux

 In this tutorial, How to use wc command in Linux. it is one of the core Linux utilities, no need to install it.

You can counts the lines, words, and bytes in a file or selection of file. etc.

wc command in Linux

The simplest way to use wc command as below:

 

As the picture, wc command scan the file and count the line, words, and bytes and display terminal windows.

You can pass multiple files to wc command.

wc command line option

The display lines in file

How to words in a file

Display characters in file use -m option

the length of the longest line in a file


Use piping input to wc command to  count the occurrences of each extension type.

 find ./* -type f | rev | cut -d'.' -f1 | rev | sort | uniq

 find ./* -type f | rev | cut -d'.' -f1 | rev | sort | uniq | wc -l

 

No comments:

Post a Comment