Search code examples
linuxmultiprocessingnetbeans-7opensusesuse

Currently running applications in Linux


I'm working on a project similar to what we call system monitor in Linux. I'm using opensuse 11.4 gnome. I was wondering if there's any command (Except ps) that lists all currently running applications on the system. I'm developing it for multi-core environment.

For example I'm browsing the web with Firefox and lets say Google Chrome simultaneously, plus I'm editing text in a text file. In this scenario, when I open my project, I want the list of all applications currently running [in my scenario, the names gEdit, Google Chrome and Firefox(but not the process these three apps generated) must be displayed as a list]

The output I want is the same as what we get in the Applications tab when we use task manager in Windows.

If anyone has a solution, please let me know it'll be highly apprecieted. I'm using netbeans to implement the project. Thanks!!!


Solution

  • Have you tried pstree yet? well this shows you a tree of the processes that are running on the system.

    htop is what I usually use for multicore enviornment cause it shows resource utilization and you can see where your processes are pinned by adding columns. htop is more userfriendly than top and has more options. when you run it just hit 't' and it will sort the processes by their parents.

    I don't know any other tools, but your other option is to go through /proc and write your own script to extract the information you need.

    I hope it helps.

    EDIT: I forgot to mention that processes are being forked in linux, so there is a parent process which starts a couple of other processes/threads. From your question, it seems that you are trying to find the parent process for each running process, my answers are based on that assumption.