
They could be a straight call to sh with a string of commands that follow.So here’s a tip for you: Download CleanMyMac to quickly solve some of the issues mentioned in this article. NOTE: Some processes that are running are not necessarily executable names. ps ax -o comm | xargs -I % basename % > /path/to/outfile.txt You'll probably notice a bit of cruft near the end related to strings that weren't meant for basename (like -bash), but the rest of what you want will be there with this quickie. In order to print just the command, there are probably more durable approaches, but in a pinch I'd just do what follows. Ps arm -o %cpu -o %mem -o command > /path/to/outfile.txt # Sort by memory usage with the 'm' option Ps arx -o %cpu -o %mem -o command > /path/to/outfile.txt Use # Sort by cpu usage with the 'r' option Here's another example which prints the cpu-usage and memory for each process (in percentages) followed by the command (process): ps ax -o %cpu -o %mem -o command > /path/to/outfile.txt


Also, check the man page for ps by typing man ps at the command line and look at other options. In case you end up wanted some of the other columns at some point. Hint: If you don't feel like typing out a full directory, drag a folder to the terminal to get the path for you and manually complete with the name of the file Simply issuing ps ax will print it to the screen. The ">" redirects the printed output (in overwrite mode) to the file. Which will print a list of all running processes (with the full name) to the file designated by the path.

In the simplest case (the one that you are most concerned about), use ps ax > /path/to/outfile.txt You mentioned that you'd like to save it to a file.
