terminal mac - bash command not found, permission denied and '&gt' in prompt

Solution 1:

The &gt; is a syntax error, apparently caused by HTML markup in whatever source you copy/pasted this from. Where you see &gt; the author intended > and where you see &lt; the author intended <. If there's an &amp; that will need to be replaced with a literal & etc.

See a listing of HTML entity codes for a somewhat more exhaustive list.