What does the command “$ls | wc –l > file1” do?

Ls becomes the input to wc which counts the number of lines it receives as input and instead of displaying this count , the value is stored in file1.

Showing Answers 1 - 1 of 1 Answers

sangee

  • Nov 15th, 2006
 

first ls command will list all the files in the current dir.then

that result is fed to wc -l which will count the number of lines fed

by the input(ie ls ),now finally the result which is the number of lines is fed to the file1.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions