Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can someone describe where the ps console command in linux gets a list of processes? It seems like anytime I run ps, the only processes that come up are bash and ps itself. Are there other commands that would give me a better list of processes so that I can "task manage" (sorry to borrow a Windows term) from console? If it makes a difference, I'm using ubuntu 10.04 ---update--- Thanks for the answers, now I'm curious about the difference between these different ps commands. ps axwww seems the most comprehensive, but ps aux seems to give more useful data (CPU and mem usage)

share|improve this question

migrated from stackoverflow.com Jul 23 '10 at 2:53

This question came from our site for professional and enthusiast programmers.

    
If you want to know what the various ps options mean, you might try "man ps", though the man page is a little dense. –  George Jul 23 '10 at 2:50
    
It gets the list from the RAM? Is that what your asking? –  jer.salamon Jul 23 '10 at 3:06
add comment

7 Answers

up vote 0 down vote accepted

ps -aef to get a more comprehensive list.

ps axwww also works fine.

share|improve this answer
add comment

Try ps aux sometime. Or if you have kde installed, you could use ksysguard. Or gnome system monitor.

share|improve this answer
add comment

I always prefer "ps fx" command but many variations can be put based on your requirement. Like "ps aux" , "ps efx" "ps -ely"

share|improve this answer
add comment

I don't know exactly where ps gets it's information. It might be from /proc/{procID}/status. For example

root@james-desktop:/# cat /proc/1/status
Name:   init
State:  S (sleeping)
Tgid:   1
Pid:    1
PPid:   0
TracerPid:  0
Uid:    0   0   0   0
Gid:    0   0   0   0
FDSize: 32
Groups: 
VmPeak:     2800 kB
VmSize:     2796 kB
VmLck:         0 kB
VmHWM:      1640 kB
VmRSS:      1640 kB
VmData:      440 kB
VmStk:        84 kB
VmExe:       100 kB
VmLib:      2068 kB
VmPTE:        32 kB
Threads:    1
SigQ:   1/7953
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000001000
SigCgt: 00000001a0012623
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: fffffffffffffeff
CapBnd: ffffffffffffffff
Cpus_allowed:   1
Cpus_allowed_list:  0
Mems_allowed:   1
Mems_allowed_list:  0
voluntary_ctxt_switches:    739
nonvoluntary_ctxt_switches: 405

I mostly use ps -ef but you can find more details on how to use ps by typing man ps. I also use top which is a bit more like a command line version of task manager but it does not show a full list of processes. Type man top to learn more about it.

share|improve this answer
add comment

ps fetches the information from the proc filesystem (/proc).

What confuses you is the fact that, by default, ps seems to only show the current process and its childs.

So it you run ps in bash this is only bash and ps itself.

Use ps -e or ps -A to show all processes on the system.

   -e              Select all processes. Identical to -A.

And be sure to read man ps for all the other useful options.

share|improve this answer
add comment

To manage processes instead of just displaying them have a look at top (installed by default on Ubuntu), atop or htop (both not installed by default on Ubuntu).

Especially for top reading the man page is necessary for everything but the most basic usage.

share|improve this answer
add comment

take a look at Hack 91. Ps Command Examples.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.