GNU/Linux Command – WC

wc – Count and Print the No. of Bytes, Words and Lines

Summary:

Print byte, word, and newline counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -, read stdin.

Examples:
$ wc -- Accept the input from stdio and count $ wc myfile -- Print the no .of bytes, words, lines in the file. $ wc -l myfile -- Print the newline counts only $ wc -w myfile -- Print the words count only $ wc -c myfile -- Print the bytes count only $ wc -L myfile -- Print the length of the longest line $ wc f1 f2 f3 -- Print the no .of bytes, words, lines in eachfile and also print the total. $ ls -1 | wc -l -- Print the no .of files present in the dir.
Read : man wc

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: