ps on remote Mac doesn't work I have a Mac Mini (latest model I believe) running OS X 10.7 at a remote location that I can only access via SSH.

The problem is that the ps command* does not work. When I run it in any form, from any user, it just freezes and I can't do anything: I'm forced to close the terminal window. The rest of the machine appears to work fine, but any script that relies on ps does not work anymore.

This has happened several times now on different remote machines (same model and OS), and can be fixed by rebooting, but I'd prefer to know the actual cause so I can prevent it happening again. Does anyone have any ideas how to fix or diagnose this problem?

*ps,top,w,killall all experience this freeze, and so does lsof when it is run as root.
I had this issue when upgrading from OS X El Capitan 10.11.6 to Sierra 10.13.6
After checking for non Apple kernel extensions as follows
kextstat | grep -v com.apple

I found a number of Acronis True Image 2020 kernel extensions
Despite moving it from Applications to the bin I had to use their cleanup_tool to fully remove the kernel extensions that were blocking ps
Once I did that, and rebooted ps -ef and other commands then worked as normal.