If i type \"composer\" i get the above error message.
I did on my macbook:
curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /us
If you have to run composer with sudo, you should change the directory of composer to
/usr/bin
this was tested on Centos8.