Questions tagged [ps]

ps is the UNIX command for retreiving process information.

From the Linux User's Manual:

DESCRIPTION
   ps displays information about a selection of the active processes.

By default, ps displays the current processes owned by the user executing the command and attached to the same process group as the shell that launches it. On most UNIX systems, the command
ps -A (or ps -e) will display information about all processes running on the system.

See also:
[unix] tag info
[process] tag info
[fork] tag info


  • For questions about the Postscript language, please use the tag instead.
  • For questions about the windows power shell, please use the tag instead.
585 questions
11
votes
4 answers

ps utility in linux (procps), how to check which CPU is used

It is about procps package, utility ps for linux. Can it print the number of last used CPU for each process (thread)? Update: Not a CPU Time (10 seconds), but a CPU NUMBER (CPU0,CPU5,CPU123)
osgx
  • 90,338
  • 53
  • 357
  • 513
11
votes
4 answers

Find the Process run by nohup command

I run a server executable in Centos using the following command "nohup server &". Now I need to kill the process "server". But I tried "ps -a" command to get the PID but I couldnt get the process. Now how to kill the "server" now?
2vision2
  • 4,933
  • 16
  • 83
  • 164
10
votes
7 answers

return code of system()

#include #include #include int main() { int res = system("ps ax -o pid -o command | grep sudoku | grep gnome > /dev/null"); printf("res = %d \n", res); return 0; } I want to see if sudoku is running or not by…
hari
  • 9,439
  • 27
  • 76
  • 110
10
votes
2 answers

Listing all running processes on server using PHP

I am trying to get a list of all processes currently running on my Ubuntu server using PHP. Ideally, I would like to get the following information: The Process ID The Command Used to Execute the Process The Arguments Given to the Process I know…
Zsw
  • 3,920
  • 4
  • 29
  • 43
10
votes
6 answers

Generating a CSV list from Linux 'ps'

Suppose I have a ps command that looks like this: ps -Ao args:80,time,user --sort time It will give me a "space" separated set of rows. A row might look like this paulnath -bash 00:00:00 I would like to convince ps to delimit by commas(or tabs…
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
9
votes
2 answers

Setting argv[0] in Haskell?

Is there a way to set argv[0] in a Haskell program (say, one compiled with ghc)? I found the getProgName and withProgName functions in System.Environment, but it doesn't seem to change what ps reports (Ubuntu). import System.Environment main = do…
ErikR
  • 51,541
  • 9
  • 73
  • 124
9
votes
1 answer

How can I get process name of specific PID with ps command in alpine

In ubuntu based docker/os $ ps PID USER TIME COMMAND 1 postgres 0:00 postgres 47 postgres 0:00 postgres: checkpointer process 48 postgres 0:00 postgres: writer process 49 postgres 0:00 postgres: wal writer process…
Shahriar
  • 13,460
  • 8
  • 78
  • 95
9
votes
1 answer

how to get certain columns from ps aux

Im using ps aux to ouput the top 10 processes on my computer sorted by memory. This is the command that I have: ps aux --sort %mem --cols 100 |tail -10 This outputs something like USER PID %CPU %MEM VSZ RSS TTY STAT START TIME…
Vandexel
  • 609
  • 2
  • 7
  • 17
9
votes
3 answers

Getting The Full Result from "ps"

How do I get the full width result for the *nix command "ps"? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything?
Daisuke Shimamoto
  • 5,206
  • 6
  • 32
  • 37
9
votes
1 answer

linux RSS from ps RES from TOP

Linux : RedHat/Fedora What is the difference between these memory values: RES from top command RSS from ps command
user1802501
  • 99
  • 1
  • 2
8
votes
5 answers

How to display the current process tree of a bash session?

I would like to create a bash alias that gives me the process tree from the current bash session I am using, up to init. The use case is to know whether I have used bash or vi's :shell command. I am using MacOS X. I have heard about pstree, but it…
Thaddee Tyl
  • 1,126
  • 1
  • 12
  • 17
8
votes
1 answer

Why does double quotes affect the printing of these echo statements in linux?

I am capturing output from ps aux: current_processes=`ps aux | grep "tempdir" | tail -3` and when I echo it, it looks like this echo $current_processes 19984 10089 17784 and when I echo plus double quote it, it looks like this: echo…
makansij
  • 9,303
  • 37
  • 105
  • 183
8
votes
2 answers

What does www mean in ps auxwww?

I found that ps aux lists processes that are currently running and I found other people mentioning ps auxwww . I am wondering what this means? or what it does? What's the difference between ps aux and ps auxwww ?
nrmb
  • 460
  • 1
  • 6
  • 17
7
votes
4 answers

how do you get window ID for xdotool automatically

I am trying to automate testing forms that selenium would take too long (javascript heavy modern forms), and I want to use xdotool and get window IDs. I see you can call xdotool selectwindow and click it, but then you have to click it each time. I…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
7
votes
2 answers

Why can't pgrep find this process?

If I execute the following, which is just a long command that will wait forever grep 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa abcd' then pgrep -f can't find the process, if I search for abcd which is contained in the…
Jasmine Lognnes
  • 6,597
  • 9
  • 38
  • 58
1 2
3
38 39