The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Identifying and grouping OS processes and APP processes wilsonee SUN Solaris 2 09-30-2008 06:26 AM
du from list with du of list total Movomito Shell Programming and Scripting 3 05-04-2008 06:33 PM
Monitoring Processes - Killing hung processes ukndoit UNIX for Advanced & Expert Users 4 01-17-2008 01:30 AM
how to generate a random list from a given list mskcc Shell Programming and Scripting 3 05-30-2006 12:30 AM
Comparing a distinct value in 1 list with another list manualvin Shell Programming and Scripting 6 06-22-2004 03:42 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 04-02-2008
Registered User
 

Join Date: Oct 2003
Posts: 69
If your flavor of Unix supports /proc filesystem then it should be pretty easy to get a little bit of information.

do "cd /proc" and if it works, do an "ls" you should see a bunch of folders, one per running pid. You can read this directory in c like any other (see man page for opendir).

If the flavor of Unix you are using doesn't support this, then you are hosed and back to either a popen for "ps" or looking up the source for it.

Last edited by DreamWarrior; 04-02-2008 at 01:25 PM.
Reply With Quote
Forum Sponsor
  #9  
Old 04-03-2008
Registered User
 

Join Date: Mar 2008
Posts: 4
Hm, this indeed seems an easy way to get a list of process-IDs. However, the information inside /proc/<processID> seems to be platform-dependent (and hard to understand anyway). Is there perhaps a way to get information about a process with a specific known ID?
Reply With Quote
  #10  
Old 04-03-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
There are different variants of how /proc works but on Linux for example, /proc/12345 contains information about process 12345; if that is not what you want, then perhaps you can explicate on what in particular you are looking for.

Also look at the proc(5) manual page, which documents the facility. (On Linux, at least, the documentation there was somewhat stale, last time I looked; but in general, it's probably correct.)
Reply With Quote
  #11  
Old 04-05-2008
sad_angle's Avatar
Registered User
 

Join Date: Jun 2001
Location: Madison, WI
Posts: 73
Try this command

$ top

$ pstree

Good luck
Reply With Quote
  #12  
Old 05-28-2008
Registered User
 

Join Date: May 2008
Posts: 1
Exclamation List of Processes in UNIX Box

Can someone please answer my query?

I need to know whether I can find out the complete list of processes that ran on a server instance in a UNIX Box under a particular user ID on a particular date.
Reply With Quote
  #13  
Old 05-31-2008
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by ranitb View Post
Can someone please answer my query?

I need to know whether I can find out the complete list of processes that ran on a server instance in a UNIX Box under a particular user ID on a particular date.
This should have been a new thread. Please don't club this under an existing one.

Coming back to the question.

Yes, its possible. Only tweak needed is to extract process information and apply all the filters that you are interested in.
Reply With Quote
  #14  
Old 06-04-2008
Registered User
 

Join Date: May 2008
Posts: 8
just try in ur c code
system(ps -eaf);
it will fill ur screen with the list of process running on ur unix system..
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0