Monday, February 23, 2009

Linux command of the week

Check out my new blog where I will be posting, http://blog.biggsk.net.

http://blog.biggsk.net/?p=160

wc

wc - print newline, word, and byte counts for each file

Which is useful for comparing line, word, and character count of files

[kpb@localhost ~]$ wc *.txt
3 6 29 test1.txt
5 10 49 test.txt
8 16 78 total

The first column is line count
The second column is word count
The third line is character count

You can also use it to get a byte count of a file:

[kpb@localhost ~]$ wc -c test.txt
49 test.txt

See the man pages for more info

Previous commands of the week:
http://blog.biggsk.net/?p=114

No comments: