You could try
This will get all lines matching the search and therefore any processes over 24Hr (which then show just a date for the start column) will be eliminated, unless there is some other reason to match them, i.e. the command string matches it.
Thanks for your help. The only problem with that command is that it lists everything. I need a command that only lists processes started less than 24 hours ago. Do you have an idea how I would do that?
Last edited by paris123; 12-28-2011 at 11:48 AM..
Reason: Making correction
My flavour of ps (procps version 3.2.7) when run as ps -ef includes the total time that the process has used, so all output lines match the grep pattern.
Maybe:
This depends on the version of ps shifting the date in place of the time and when it does that; it might not be precise. I note on my system, processes that were started less than 24 hours ago, show Dec27 (rolls at midnight?), so if you really need all processes started in the last 24 hours you might turn to something like this:
This is a real hack, and probably won't work on every system (certainly needs the proc file system to be functional), but it does present every process that was started during the past 24 hours (using the time that you run this command pipeline) and not just since midnight which is what you'll get if you depend on filtering away things like Dec21.
---------- Post updated at 11:17 ---------- Previous update was at 11:15 ----------
Sorry but I do not believe that your "ps -ef" outputs dates in that format.
Please can you post some complete output lines (in code tags) taking special care to preserve any spacing.
Also it's time we knew what Operating System this is (blotting anything confidential like machine names and licence numbers):