ps is a command for printing information about running processes
44
votes
8answers
2k views
How can I prevent 'grep' from showing up in ps results?
When I search for some process that doesn't exist, e.g.
$ ps aux | grep fnord
wayne 15745 0.0 0.0 13580 928 pts/6 S+ 03:58 0:00 grep fnord
Obviously I ...
24
votes
2answers
1k views
In what order do piped commands run?
I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about ...
19
votes
3answers
30k views
How can I get a full process list in solaris, without truncated lines?
Is there a way to generate a full process listing in solaris, without truncated lines? I've tried the ps commmand, with the following arguments:
-f Generates a full listing. ...
18
votes
3answers
4k views
What are “session leaders” in `ps`?
What are session leaders, as in ps -d which selects all processes except session leaders?
12
votes
2answers
267 views
When was a process started
To know when was a process started, my first guess was to check the time when /proc/<pid>/cmdline was written/modified the last time.
ps also shows a START field. I thought both of these ...
11
votes
3answers
3k views
What would cause ps to report uid instead of username?
I have Eucalyptus installed on my Linux machine, and I've noticed that for processes owned by the eucalyptus user, ps reports the userid instead of the username. For example:
$ sudo -i -u eucalyptus
...
10
votes
2answers
4k views
What do the brackets around processes mean?
mark@mark-VirtualBox:~/auto/lib$ ps -Awwo pid,comm,args
PID COMMAND COMMAND
1 init /sbin/init
2 kthreadd [kthreadd]
3 ksoftirqd/0 [ksoftirqd/0]
5 ...
10
votes
2answers
2k views
Why does `htop` show more process than `ps`
In ps xf
26395 pts/78 Ss 0:00 \_ bash
27016 pts/78 Sl+ 0:04 | \_ unicorn_rails master -c config/unicorn.rb
27042 pts/78 Sl+ 0:00 | ...
9
votes
1answer
2k views
Why the value of VSIZE in top is different from the value of VSZ (Virtual set size) in ps?
I know VSZ in ps is for the total address space allocated for the app and is sometimes aliased as vsize (mentioned in man page of ps on linux), but what's the definition of VSIZE in top? This top ...
8
votes
2answers
453 views
Which to choose - BSD or Unix-style commands where available?
Commands like ps come with a lot of parameters, especially because they give the use an option to choose between Unix and BSD style flags. I hope you get my point here.
So, when there's such an ...
8
votes
2answers
159 views
Look for a process with a given name
I am trying to convert the VMS command show/system/process=processname into an equivalent Linux command.
I tried the following but it returned none of the processes:
ps -C /exeimages/processname.pl ...
6
votes
1answer
239 views
Why does “kill -9 0” end my console session?
I just wonder why kill -9 0 ends my tty console session?
What exactly is PID 0, it is not listed on a ps aux?
6
votes
2answers
508 views
Difference between free -m and ps -euf
I'm not an expert on linux so I do apologize in advance for the silly question.
I have a vps machine with ubuntu 10.04 and 512Mb of RAM. I'm trying to guess how much memory is available after running ...
5
votes
5answers
771 views
Piping PS output into a Text file
So what im wanting to do is pretty basic.....but im not sure how to go about it.
Lets say I have a program running, but I want to pipe the output of ps -C "ProgramXX" into a file.
Normally Running ps ...
5
votes
4answers
1k views
Finding the ID of a process and killing it
When ever I need to kill a background process I do ps -e | grep <process_name>
Which prints something like this 1766 ? 00:00:13 conky , Then I use the process ID to kill it like so kill 1766 .
...
5
votes
4answers
6k views
Show top five CPU consuming processes with `ps`
How to show top five CPU consuming processes with ps?
5
votes
1answer
110 views
Find all users who have more than N processes and echo them in shell
I'm writing a script in ksh. I need to find all users who have more than N processes and echo them in the shell. N is read from ksh.
I know that I should use ps -elf, but how do I parse it, find ...
5
votes
2answers
1k views
killall gives me `no process found ` but ps
Could somebody explain to me the difference between kill and killall? Why doesn't killall see what ps shows?
# ps aux |grep db2
root 1123 0.0 0.8 841300 33956 pts/1 Sl 11:48 0:00 ...
5
votes
2answers
667 views
If I see a process running using ps, how can I find the executable?
If I can see a process running using ps -e, how can I find the file which launched it?
4
votes
1answer
223 views
What does <defunct> mean in the output of ps?
I had issued the ps -ef|grep java command and this is one of the entries that I got :
subhrcho 875 803 0 Jan23 pts/5 00:02:27 [java] <defunct>
What is <defunct> implying here ? ...
4
votes
2answers
174 views
How to list all running X applications?
I'd like to get a list of all of the apps (across all users) on my machine that are talking to the X server. What's the most reliable way to do that? Find the socket X runs on and lsof for connections ...
4
votes
1answer
80 views
Elegantly get list of children processes
I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g"
Is there any ...
4
votes
1answer
485 views
Difference between poll_s and ep_poll WCHAN in ps output
When I issue ps -elf|grep python for example on my system, I see these:
1 S 1000 6020 6008 0 80 0 - 9914 poll_s Jul12 ? 00:00:01 python manage.py run_gunicorn -t 3600 -w 8 -b ...
4
votes
3answers
76 views
Uniquely identifying java processes with same name
I have two java processes which run using the same file name, MyApp.jar (for example).
/usr/java/latest/bin/java -jar MyApp.jar
These jars exist in different places and use different ...
3
votes
4answers
1k views
Solaris ptree style tool for Linux
I'm looking for the Linux tool that will print the same output as the Solaris ptree.
For example:
# ptree 538
538 /usr/lib/ssh/sshd
889 /usr/lib/ssh/sshd
890 /usr/lib/ssh/sshd
1498 ...
3
votes
2answers
816 views
How to list only non-<defunct> processes?
Is there a combination of command-line options for ps or pgrep or some other relatively direct way to determine if a particular process name is actually running (available for normal use)..
By ...
3
votes
1answer
25 views
-p and -o comm doesn't work together?
I'm trying to get CPU usage of a process by,
ps -p 12990 -o comm=comm,pcpu
But that only print the command name (the process does exist), what's wrong with it?
3
votes
1answer
882 views
Understanding ps elapsed time format for long running processes
I'm using a ps command as part of an exercise to identify processes running longer than a given threshold.
I'm using the following template to get the elapsed time for a know process command:
ps -eo ...
3
votes
3answers
222 views
What's the best way to determine the working directory for UNIX process using 'ps'?
I am running a Ruby command line script (rufus.sh)which ultimately calls Thread.new, which spawns a UNIX process as shown below. I run this script for more than 1 directory as the output of the ps ...
3
votes
1answer
83 views
Get process list with logical intersection of selectors?
The Linux ps command allows multiple selectors, such as user and command name, but always returns the logical OR of those selectors (more than I want). Does anyone know of a method or tool already ...
3
votes
1answer
201 views
HP-UX SZ limit for ps?
Right so I have a fun little thing that I'm deathly confuzzled about. I have a program that is running and I am getting the following:
using top:
SIZE RES
1639M 359M
using ps:
SZ
20171
...
3
votes
0answers
78 views
Elegantly get list of descendant processes
I would like to get a list of all the processes that descend (e.g. children, grand-children, etc) from $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ ...
3
votes
0answers
98 views
Can I get WCHAN from ps on Mac OS X 10.7.4?
From the manual it seems that ps -AO wchan should tell me what everything is sleeping on, but everything comes up as -. (And nwchan as 0). Did they do away with the old sleep()/tsleep() interface in ...
2
votes
1answer
3k views
What does this process STAT indicates?
If you check the STAT column in above image you will see Ss S S< SN and R+
What does this indicates ? Process states.
If yes,Then what is the significance of 'Ss S< SN and R+'?
2
votes
4answers
541 views
How to run java process to be seen not as 'java…' in processes list?
Is it possible to run a Java process in Linux in a way that it could be seen in ps as some sort of alias? It would be easier to restart it when it is down.
2
votes
2answers
887 views
Top and ps not showing the same cpu result
This is linked to this question.
When I run top I get the following result:
pid 3038 is using 18% cpu, however when running
the result is 5.5%. And this number does not appear to be changing ...
2
votes
2answers
521 views
How can I get a list of long running processes that match a particular pattern?
I know that I can do ps aux | grep cgi to get a list of all cgi scripts currently running, and ps -p [pid] -o etime= can get me the run time for each pid; is there a way to combine the two, or better ...
2
votes
3answers
2k views
Alternative to `pkill` or `pgrep -f` on cygwin?
Suppose I have starting my process like:
java -DSOME_STRING -jar foo.jar
Then on linux, I can use the following to find or kill this process:
pgrep -f SOME_STRING
pkill -f SOME_STRING
However ...
2
votes
1answer
796 views
A more readable ps
Are there any tools that improve the readability of ps in the same spirit as ack for grep?
This would be especially on OS X where ps does not even have options such as --sort user.
So far the nicest ...
2
votes
1answer
94 views
What does a “[1]+ Exit 1” response mean?
I ran this command to try and get my python program to run in the background and let me exit the SSH connection I am using:
nohup python files.py >> files.log &
I then check ps to check ...
2
votes
1answer
3k views
How to find out total memory resource usage with ps?
With ps command I can find out how much memory each program uses:
ps -u mertnuhoglu -o pcpu,rss,pid,command
Is it possible to find out the sums of each type of resource usage as well, easily?
2
votes
2answers
101 views
Print like Firefox
Made a CLI script to print Wikipedia articles:
WIKI='https://en.wikipedia.org/w/index.php?title='
TITLE=$1
PRINTABLE='&printable=yes'
SRC=$WIKI$TITLE$PRINTABLE
HTML=$1".html"
PS=$1".ps"
wget ...
2
votes
1answer
1k views
Mathematical connection between SZ RSS and VSZ in ps o/p?
I wanted to know what mathematical connection is there between the SZ, RSZ and VSZ output in ps output e.g.
ps -p 2363 -o sz,rss,vsz
2
votes
1answer
1k views
parsing process ID/names from /proc, thread IDs
When I'm parsing process IDs from /proc, obviously each thread of a process gets its own ID. And I realize that all the threads in that same process can be gathered from /proc/${pid}/task/.
But my ...
2
votes
1answer
611 views
ps command not giving output in home directory
I am logging into a solaris server, switching to bash, then switching to another user "sruser" and switching to bash.
/home/batch/sruser/ is the home directory of the user "sruser".
The issue is ps ...
2
votes
1answer
220 views
Linux : See CPU usage by a process for the last second
vmstat 1
Above will print virtual memory statistics each seconds. It will also show the CPU utilization for last second.
I have a web server at hand which runs httpd and MySQL. I need to find how ...
2
votes
4answers
75 views
Capture complete process structure/stack
There are a lot of java processes running on the server, generally, we capture the PIDs of the java processes using command 'ps -ef | grep java'. In general, the java processes have a lot of jars in ...
2
votes
1answer
4k views
Among “ps” command output fields, %CPU isn't the actual CPU usage of the process?
For example, one of the output fields of this BSD style command, ps aux, is "%CPU". The alternative command, ps -efl outputs the "C" (or CP) field.
As per the ps man page:
%CPU is the cpu ...
2
votes
1answer
80 views
“ps” output and comments
I'm pretty sure you cant do this but maybe someone has some weird hack...
Is there a way to get comments (#blahblah) to show up in ps output?
My problem is that i have a script, lets call it ...
2
votes
1answer
259 views
PS command ouput limited to 80 bytes only [duplicate]
Possible Duplicate:
How can I get a full process list in solaris, without truncated lines?
The output of ps command only returns 80 bytes.
Below is the text from manual pages of Solaris ps ...
