Tagged Questions
0
votes
2answers
42 views
`ps | grep | kill` aborts my script prematurely [duplicate]
I have a Linux computer that I remotely SSH into using plink on a Windows XP machine. I have the Plink program set to execute commands in a script using automated login:
plink -ssh [domain name] -l ...
1
vote
1answer
60 views
How to watch pgrep?
When running a pgrep command with watch it does not only show the actual pgrep output, but also the watch process as well.
Example:
watch pgrep -lf donothing
will show 3 processes, although
...
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]/ ...
2
votes
1answer
222 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 ...
4
votes
1answer
83 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 ...
6
votes
1answer
242 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?
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 ...
4
votes
1answer
224 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 ? ...
-3
votes
2answers
363 views
Please explain this output of ps -ef command?
A part of the output from the ps -ef command is given below :
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 2012 ? 00:00:01 init [3]
root 2 ...
0
votes
3answers
259 views
What is the difference between ps and top command?
What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
12
votes
2answers
268 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 ...
0
votes
0answers
26 views
How can I see a process' thread count? [duplicate]
Possible Duplicate:
Is there a way to see details of all the threads that a process has in Linux?
I want to see the thread count which belongs to a process in linux. What command should I ...
0
votes
0answers
99 views
Very large values for utime and stime for foo. Is foo still running?
I am running a program foo
It has been running for close to 30 days now (even more)
Until around 10 days ago (I cannot be very exact) it used 100% of one cpu on my dual core laptop (it was at the ...
1
vote
3answers
178 views
I want to kill all processes that result from the following command
The following command will display all the PID's running for vmstat1:
ps -ef | grep "vmstat 1" | awk '{ print $2 }'
My question is, how do I kill them all, if there's like 20 of them at once?
0
votes
2answers
135 views
receiving command as a parameter in bash
I have a following simple script called single-instance that executes the given command if there is no process under that command running. If I hard-code the command after the else statement, it has ...
3
votes
1answer
883 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
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 ...
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 ...
0
votes
1answer
382 views
The TIME field in ps -ef
When I do ps -ef, I see "TIME" field. What does this field mean? From what I understand, this tells the actual CPU time, that the process got (amidst all the context switching). Does the TIME field ...
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 ...
5
votes
2answers
673 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?
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 .
...
1
vote
3answers
2k views
Why is apache2 showing up a defunct in the process list?
When I run top I see one line that doesn't look too good:
2475 www-data 20 0 0 0 0 Z 1 0.0 0:00.19 apache2 <defunct>
Why is this process <defunct> and what should I ...
3
votes
3answers
224 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 ...
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 ...
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
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+'?
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?
2
votes
1answer
800 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
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 ...
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 ...
3
votes
2answers
819 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 ...
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 | ...
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. ...
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
...