CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS OPERATING SYSTEMS UNIX COMMANDS DETAILS
Question :
Is it possible to count number char, line in a file; if so, How?
Category Unix Commands Interview Questions
Rating (4.2) By 26 users
Added on 10/25/2004
Views 10435
Rate it!
Answers:

Yes, wc-stands for word count.
wc -c for counting number of characters in a file.
wc -l for counting lines in a file.





YES
WC = is the word count in UNIX it counts number of character as well as number of lines in Program



 Posted by: Praveen Patil    

Contact Praveen Patil  Contact Praveen Patil

wc only this command gives all the three
1. no of words
2. no of new lines
3. no of characters



 Posted by: Rajeev kumar    

Contact Rajeev kumar  Contact Rajeev kumar

wc -w prakash
wc -c prakash
wc -l prakash



 Posted by: prakash    

Contact prakash  Contact prakash

we can count number of lines and characters by using the cmmnd "wc".It is nothing but wordcount cmmnd.
to count no.of lines is $wc | -l > filename
$wc -l filename
$wc -c filename



 Posted by: chinni    

Contact chinni  Contact chinni

wc and its options can count no.of line no.of words and no.character.
wc <file1> it count no.of lines,no.of words and no.character in file1
wc -l <file1> it counts the no.of lines only in file 1
wc -w <file1> it counts the no.of words only in file 1
wc -c <file1> it counts the no.of character only in file 1



 Posted by: Niraj Kumar    

Contact Niraj Kumar  Contact Niraj Kumar

Yes. It is Possible. Here, W represents No. of Words, C represents No. of Character.
E.x:
ls | wc



 Posted by: Gokul     

Contact Gokul    Contact Gokul

wc (word count) for count characters



 Posted by: LOKESH    

Contact LOKESH  Contact LOKESH


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
Is ?du? a command? If so, what is its use?
View Answer
What is the use of the command "ls -x chapter[1-5]"
View Answer
Is it possible to restrict incoming message?
View Answer
Is it possible to create new a file system in UNIX?
View Answer
What will the following command do?
View Answer
Write a command to display a file?s contents in various formats?
View Answer
Which command is used to delete all files in the current directory and all its sub-directories?
View Answer
Write a command to kill the last background job?
View Answer
What is the difference between cat and more command?
View Answer
What is the use of ?grep? command?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Unix Commands Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/2016/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.83