To understand the practical use of Grep's option -H in different situations
grep
Solution
Grep will list the filenames by default if more than one filename is given. The `-H` option makes it do that even if only one filename is given. In both your examples, more than one filename is given.
Here's a better example:
$ grep Richie notes.txt
Richie wears glasses.
$ grep -H Richie notes.txt
notes.txt:Richie wears glasses.
It's more useful when you're giving it a wildcard for an unknown number of files, and you always want the filenames printed even if the wildcard only matches one file.
Problem
This question is based on this answer. Why do you get the same output from the both commands? Command A ``` $sudo grep muel * /tmp masi:muel ``` Command B ``` $sudo grep -H muel * /tmp masi:muel ``` Rob's comment suggests me that Command A should not give me `masi:`, but only `muel`. In short, what is the practical purpose of `-H`?