Apart from the fact that the commands are actually different... You're using the wrong character for the pipe.
The correct character is
Grep interprets it as a filename, that's why the commands fail.
In the future it will be much easier for others to help if you include the text itself, not a screenshot. We can copy and paste text into our own terminals while we can't do so with images.
Here it looks like you're using a "broken bar" character
¦ where you should be using a "vertical bar"
| (used as a pipe operator in bash). I'm guessing whatever "machine" console you mention (not shown?) interprets the keyboard press as a vertical bar, while Windows (git bash and putty) interpret it as a broken one.