-bash: cat: command not found (or grep)

Hi, Strange things:




i3: okn$ ls -R | grep -h "dof" | cat > dtext.txt

-bash: cat: command not found


or then I get this:


i3: okn$ find . -type f -print | grep -c

-bash: grep: command not found


but this is not happening all the time, i remember grep or cat did work once or twice...



What's going on here?


OS 10.7.4; repaired permissions


Any assistance much appreciated!


/ bw, Omar KN

Mac OS X (10.7.2)

Posted on Jul 9, 2012 2:52 PM

Reply
19 replies

Jul 21, 2012 7:42 AM in response to BobHarris

>cat -vte will display invisible and control characters


Tried that, thank you, but nothing strange here.



Also I took away a SHORTKEY which I had in Things, a Mac OS X app,

where the shortkey was ALT - SPACE.


Well maybe when writing the pipe, which is done on my keyboard with: ALT - 7 and when lifting the fingers off the 7 to press the SPACE, something was too fast, possibly.


Maybe related is the fact that on quite a few occasions on my webpages, empty spaces (but even between letters) something produces an " Â ", ie. an A with a roof on it, like you need in French, â = circonflex.

Now I never wrote this  -thing, it just introduces itself into the text sometimes.


Anyway, I'm glad for all the help I got and can now use again the grep and other commands in the terminal!


bw, Omar K N

Jul 21, 2012 12:21 PM in response to Omar.KN

If you're encountering random characters in your data input, it would appear you have a problem with your keyboard, with OS X, or with your Mac hardware. If the random caracters are arising in your data output, then you're looking at some sort of problem arising somewhere between where your data is stored and the OS X rendering; with OS X or with your storage.


Swap your keyboard for a different USB keyboard, and see if things start working.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

-bash: cat: command not found (or grep)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.