Tagged Questions

ps is a command for printing information about running processes

learn more… | top users | synonyms

1
vote
3answers
1k 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?
1
vote
2answers
175 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 ...
1
vote
1answer
233 views

Linux + Solaris how to verify the last execute process from list of process

I need advice: How to verify which is the last scan_sys.sh process that run in my linux or solaris ? my target is to kill all scan_sys.sh process , except the latest scan_sys.sh ( the last execute ...
2
votes
0answers
356 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 ...
3
votes
1answer
4k 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 ...
1
vote
1answer
690 views

Bafflingly baroque Debian ps: show threads in forest tree

My favourite ps invocation is: ps -efww ef as I need to watch all processes (-e), get extended information about them (-f), see the environment (e) they operate within, wrapping lines (-w -w) so I ...
3
votes
0answers
147 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 ...
1
vote
2answers
1k views

Where to find the source code for ps?

I want to check out the source code for commands such as ps. It seems to be impossible to search LXR (linux.no) for "ps". Where do I find it?
1
vote
1answer
76 views

PS tags does not work

I run a ps command inside a startup script, if I put in: ps -A -o euser,pid... I get this output: EUSER PID CMD %CPU RSS SZ ELAPSED root 644 ./code ...
0
votes
2answers
207 views

Total RAM used by a program with `ps`? [duplicate]

Possible Duplicate: Measuring RAM usage of a program I am trying to use ps to benchmark a program, I'm just not sure which flags to use. I would like to get the amount of RAM the program ...
4
votes
1answer
1k 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 ...
2
votes
2answers
151 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 ...
39
votes
4answers
4k 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 ...
0
votes
1answer
1k 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 ...
4
votes
1answer
124 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 ...
4
votes
1answer
2k 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
7k 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 ...
7
votes
3answers
3k 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?
6
votes
4answers
4k 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
5k 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 ...
4
votes
2answers
425 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 ...
1
vote
4answers
880 views

Call 'ps' as a normal user in Linux

A brief introduction to my question: the command ps will print the information of system processes. But when I login as root and change the permission x of ps chmod -x /bin/ps chmod u+x /bin/ps ls ...
1
vote
6answers
5k views

How do use awk along with a command to show the process ID with the 'ps' command

I'm able to to show the PID (2nd) column with the below command, but instead I want to show pwdx <PID> and also the COMMAND(8th) column. Thanks in advance, Chirag ps -ef | grep runner | awk ...
4
votes
3answers
896 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
346 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 ...
24
votes
2answers
9k 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 ...
5
votes
5answers
2k 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 ...
3
votes
1answer
4k 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?
7
votes
4answers
4k 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
4answers
1k 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.
6
votes
2answers
928 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 ...
2
votes
3answers
4k 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 ...
12
votes
2answers
701 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
1answer
11k 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+'?
9
votes
1answer
5k 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 ...
28
votes
3answers
10k views

What are “session leaders” in `ps`?

What are session leaders, as in ps -d which selects all processes except session leaders?
2
votes
2answers
5k views

Frequently used “ps” (process status) commands in linux? [closed]

EDITED: These are the the only most commonly used (and important) ps command options I've come across so far: $ ps ux, $ ps au, $ ps aux, $ ps U aahan, $ ps uU aahan So, is that all, or am I missing ...
2
votes
1answer
2k 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
2answers
1k 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
1answer
2k 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 ...
6
votes
3answers
3k 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 ...
12
votes
6answers
35k views

Show top five CPU consuming processes with `ps`

How to show top five CPU consuming processes with ps?
3
votes
2answers
1k 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 ...
20
votes
2answers
6k 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 | ...
3
votes
1answer
1k 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 ...
31
votes
4answers
61k 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 command, with the following arguments: -f Generates a full listing. ...
1
vote
4answers
2k views

Using regex to see if a UNIX process is up

In UNIX, I am checking to see if a process is up by executing the following command; E.g. psg dtllst pe99 This returns the following output if the process is running; UID PID PPID C ...
12
votes
3answers
6k 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 ...
7
votes
2answers
984 views

grep - why do brackets in grep pattern remove the grep process from ps results?

Why do brackets in a grep pattern remove the grep process from ps results? $ ps -ef | grep XXXX [...] XXXX [...] grep XXXX $ ps -ef | grep [X]XXX [...] XXXX