Combine grep and wc to print how many lines results there we

Combine grep and wc to print how many lines (results) there were for the answer in 2a.

a. $ man wc

b. $ grep … | wc …

c. Write down the command.

Solution

a)man wc

Gives the manual of wc command

b) grep -r \"some pattern \" | wc -l \"filename.text\"

wc command without parameter returns number of lines number of words,number of bytes.

-l is used to return the number of lines in the file.

Combine grep and wc to print how many lines (results) there were for the answer in 2a. a. $ man wc b. $ grep … | wc … c. Write down the command.Solutiona)man wc

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site