LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-15-2006, 12:22 PM   #1
sharapchi
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: slackware
Posts: 119

Rep: Reputation: 15
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.
 
Old 12-15-2006, 12:28 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,989

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
And how can I get some one else to do my homework.
 
Old 12-15-2006, 12:33 PM   #3
fvu
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu 7.10
Posts: 28

Rep: Reputation: 15
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
 
Old 12-15-2006, 12:43 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Have a read of the wc manual page:
Code:
man wc
All the answers you seek are there.
 
Old 12-15-2006, 12:45 PM   #5
sharapchi
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: slackware
Posts: 119

Original Poster
Rep: Reputation: 15
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.

Last edited by sharapchi; 12-15-2006 at 01:41 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash : remove replicator words?, how? Guru Mind Programming 13 05-18-2006 12:24 AM
Bash - How to make For read lines instead of words in a list ? landuchi Programming 10 02-15-2006 01:36 PM
[bash] Put words from file to array mispunt Programming 4 11-04-2004 10:53 AM
BASH: First words in a line JordanH Programming 7 10-24-2004 10:00 AM
Giving multiple words as argument for bash ivanatora Linux - General 5 01-07-2004 02:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration