Loading
Home ›
Using ps to Monitor Processes
Jun 02, 2009 By Janos Gyerik
in
In a previous tech tip, we saw how to use kill to monitor processes. Another option is to use ps. With both methods, you can check $? for success/failure. However, note that kill -0 may return failure even if the process actually exists. This happens when the current user has no permission to the process in question, for example: kill -0 1.
To check for a process silently (with no output), use:
kill -0 PID 2>/dev/null ps -p PID >/dev/null
______________________
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Linux-Based X Terminals with XDMCP
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Parallel Programming with NVIDIA CUDA
- You Need A Budget
- Validate an E-Mail Address with PHP, the Right Way
- The Linux powered LAN Gaming House
- The Linux RAID-1, 4, 5 Code
- Python for Android
- Gnome3 is such a POS. No one
3 hours 36 min ago - Gnome 3 is the biggest POS
3 hours 46 min ago - I didn't knew this thing by
9 hours 51 min ago - Author's reply
13 hours 15 min ago - Link to modlys
14 hours 22 min ago - I use YNAB because of the
14 hours 33 min ago - Search
19 hours 36 min ago - Question
20 hours 1 sec ago - for the record
20 hours 2 min ago - That's disappointing. Thanks
22 hours 25 min ago





Comments
I tend to use the command
I tend to use the command "pgrep process-pattern". It seems to do the trick as well and has many options to tailor command behaviour.
I like this how2
I like this how2