Process list in Linux

Hi guys,

is there a command line or smart programming way in linux to get the following information about the system

a list of the running process names only
a list of the running services names only.

Thanks
Damon

Here is what I have found,

it lists all the processes both running and sleeping which are not owned by ROOT user

dim s,q ,p as string
dim i,i1 as integer
dim sh as new shell

sh.Execute  "ps -U root -u root -N"
q=sh.Result
dim proc(-1) as string

i1=CountFields(q,chr(10) )
for i= 2 to i1
  p= NthField(q,chr(10),i)
  p=mid(p,25,20)
  p=trim(p)
  if p<>"" then proc.Append p
next
proc.Sort

i1=UBound(proc)
for i= 0 to i1
  s=s+proc(i)+EndOfLine
next

hope this helps someone.

Thanks
Damon

If you use MBS Plugins, you could use LinuxProcessMBS class.

What’s this plugin called Christian ?

MBS Xojo Linux Plugin :slight_smile:

and documentation is here:
https://www.monkeybreadsoftware.net/class-linuxprocessmbs.shtml

All your running processes are written to /proc.

Instead of using ps you can also extract the informations from /proc… See link for more informations: http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html

Yes, and MBS Plugin reads /proc.