[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Favorite commands: wc


How about people post some stuff about Perl one-liners as well as their
favorite commands on this mailing list?  I'd like to see what others
find useful.

One command that is cool is good old wc (short for word count).  Word
count can count the number of words, lines, or characters in a text file
or pretty much anything you feed it. "wc -l", for example will tell you
the number of lines something has.  

For example,  

"cat foo.txt|grep the | wc -l"  

will tell you the number of lines that contain the word "the" in the
file foo.txt.  You can do this slightly more compactly without using
cat, but I used it for clarity.  

wc rocks because I am too lazy to count things.  

I'd like to see someone talk about awk and sed.  I used to know how to
do nifty stuff with them, but then I discovered Perl...



To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.