How Do I Continuously Do a Ps Auxw on Osx?
The Question Is This: If I Open Terminal and Type Ps Auxw, I See a List of All Processes Running but This Command Is Like a Snapshot of That Instant. What I...
The question is this: If I open terminal and type ps auxw, I see a list of all processes running but this command is like a snapshot of that instant. What I need is this:
I am trying to discover what process is being run by an app that is crashing just after launching. I will use the finder and double click on the app icon to execute it. For a brief moment I know the app will launch and then crash.
How do I have a terminal window monitoring the running processes all the time, so when the app launches for a brief instant, that monitoring captures the process and lists it on terminal?
How do I do that? thanks.
3 Answers
You can indeed use watch for this. Alternatives are
topandhtop: these display processes in continuously updating windows.Use the shell
while true; do ps auxw; sleep 1; doneUse
straceon Linux orktraceon OSX.
I used a modified command provided by @terdon:
while true; do ps auxw >> ps.txt; date >> ps.txt; sleep 1; done
I did this to make it easier to track the processes running at a given moment.