I am studying bash commands in the Web Development path. I am currently doing this project and point 4 reads like this:
Redirect plants.txt as standard input to the wordcount command. Use the
-l option on the wordcount command.
I’d have done something like this (which doesn’t work):
cat plants.txt | wc -l
Instead, the suggested solution is this:
wc -l < plants.txt
Can anyone please help me understand why the suggested solution works, while mine doesn’t?
Thank you in advance.