Command not found after pipe

This is common error which happened in mac OS X when you copy ans paste command line. what you can do is to delete the space before and after the |

for example kubectl get pods | grep bla-bla-bla is now kubectl get pods|grep bla-bla-bla

hope that's help


The fact that it's happening only sometimes indicates that your input actually varies (subtly) from time to time.

It depends on what kind of keyboard you have, but I think it's likely that you're accidentally holding down the Alt key while you type the space after the pipe. Alt+Space is a non-breaking space, which zsh won't recognise.