How do you inspect running processes on Linux?
Answer
Use `ps` for a process snapshot, often `ps aux` or `ps -ef`, and `top` for an interactive changing view of CPU and memory usage. `pgrep` can locate PIDs by process name. For a specific service, combine process inspection with the service manager rather than treating a matching process name as proof that the service is healthy.
Strong answer includes
- ps is a snapshot while top is interactive
- can locate a PID with pgrep or ps filtering
- process existence is not the same as application health
Practical example
When a test server becomes slow, `top` may show one Java process consuming a CPU core. Then `ps -fp <pid>` confirms its command line before anyone restarts or kills the wrong process.