Computer Science - Unix - Discussion

Discussion :: Unix - Section 1 (Q.No.9)


Which command sends the word count of the file infile to the newfile.

[A]. wc infile >newfile
[B]. wc <infile >newfile
[C]. wc infile - newfile
[D]. wc infile | newfile
[E]. None of the above

Answer: Option A


No answer description available for this question.

Siva Rajesh said: (Jul 11, 2013)  
wc command gives other details like number of lines and characters.

"wc -w" will give the exact number of words of a file.

So for the above question the correct answer is,

wc -w infile>newfile

Narayanan said: (Dec 16, 2013)  
But wc -w infile>newfile option is not present.

Abd said: (Jan 17, 2014)  
Why not wc infile | newfile?

Rohit said: (Aug 3, 2014)  
wc <infile >newfile.

It can also be used to copy word count,line number and characters to newfile.

So option A and B both is right.

Rishab said: (Nov 17, 2015)  
Agreed with @Rohit.

I was going to say the same thing also. A and B are both correct.

And also we need wc-w.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.