With grep, you can search using regular expressions for pattern-matching and more.
While this is more of a combination of commands than a pure ps command, it’s a regular part of any administrator’s tool belt. If you want more flexibility to search within the results from ps, you can pipe the results to grep. This can take multiple PIDs as arguments, separated by a single comma and no space. If you know the process ID of the running process you want to show, you can filter for it specifically with the -p flag. The search is not case sensitive, but all process names are in lower case at any rate. Searches for a specified process name and returns only the PID of that process. Can also be used with a lower-case u to search by UID instead of username. Filter by Userįilters ps results to only show processes owned by the specified username. You can also replace the -e flag with -A, which has an identical effect. To show the usernames associated with these processes, add the -u flag to your command. This data includes columns showing UID, PID, parent PID, recent CPU usage, process start time, controlling terminal, elapsed CPU usage, and the associated command.
APPLE MAC TERMINAL COMMANDS FULL
Shows all running processes with full data about every process. Start adding additional flags, and you can see different sets of processes from across the system and owners. Run the command with no flags, and it will show only the processes associated with the currently-running terminal. It reports currently-running processes with a variety of filters and views. The command stands for “process status,” and that’s largely what it does. For system administrators, ps on macOS is a frequently-used tool.