LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   how many lines and words (bash) (http://www.linuxquestions.org/questions/programming-9/how-many-lines-and-words-bash-510768/)

sharapchi 12-15-2006 01:22 PM

how many lines and words (bash)
 
How can i get the number of lines in a file and how can i learn the number of words in a line with using bash programming?

Thanks.

kilgoretrout 12-15-2006 01:28 PM

And how can I get some one else to do my homework.

fvu 12-15-2006 01:33 PM

wc -l [FILE] print the newline counts
wc -w [FILE] print the word counts

See: man wc or info wc

Freddy Vulto
http://www.fvue.nl

matthewg42 12-15-2006 01:43 PM

Have a read of the wc manual page:
Code:

man wc
All the answers you seek are there.

sharapchi 12-15-2006 01:45 PM

I am so happy hearing these words from a senior member. I am only trying to improve myself on linux commands and bash nowadays. And i havent heard about a command named "wc". Thanks fvu and matthew. And for all helping penguins trying to walk.


All times are GMT -5. The time now is 03:40 AM.