Sponsored Content
Top Forums UNIX for Advanced & Expert Users delete all PID that running by UID ?? Post 302277791 by thepurple on Sunday 18th of January 2009 04:23:59 AM
Old 01-18-2009
delete all PID that running by UID ??

Hi experts,

How can I delete the process running by particular UID. For an example-

I want to delete all PID that running by UID- purple

Code:
UID      PID    PPID   C   STIME   TTY      TIME CMD
purple   120     122    0   Jan 17   ?        0:02 sched
purple   234     235    0   Jan 17   ?        6:17 /home/ritmouser/script/myscript.sh
purple   455     456    0   Jan 17   ?        0:00 pageoutin
purple   4576    4678   1   Jan 17   ?       4545:56 fsflush
purple   503     1      0   Jan 17   ?        0:00 sh -c /usr/bin/ritmouser/script1
purple   130     1      0   Jan 17   ?        0:02 /usr/sbin/rpcbind
purple   348     1      0   Jan 17   ?        0:00 sh -c /usr/bin/ritmouser/script1
purple    56     1      0   Jan 17   ?       115:34 /usr/lib/picl/picld
purple   151     1      0   Jan 17   ?        0:25 /home/ritmouser/script/myscript.sh

meanwhile, what is column "C" ??

Let me correct if i am wrong- PID = child process id
PPID= parent process id
best regards,

purple
 

10 More Discussions You Might Find Interesting

1. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

2. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

3. Shell Programming and Scripting

Need to know rhe PID for the Shell Script running

I have a Shell Scritp named "Statistics" which has a Infinate Wille Loop Running I want to restart this Srcipt "Statistics" when i try to run other srcipt Ex "ABC" so i want to kill the "Statistics" script in "ABC" so for this I what to know the PID for that Script "Statistics" which is... (7 Replies)
Discussion started by: pbsrinivas
7 Replies

4. UNIX for Dummies Questions & Answers

UID & GID of the running process

Hi, out of curosity this question just popped in my mind. Is there any way to find out the uid and gid of the running process ? If i do a ls -l of a program then it shows the uid/gid bit (if its set). I want to see as which user/group the program is running ..... is there any way to know this... (2 Replies)
Discussion started by: ankurjain
2 Replies

5. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

6. UNIX for Dummies Questions & Answers

How to find the details of the previously running process with PID

OS: Unix or Linux I (only) know the pid of the process which was running earlier (say 5 hrs back) but it is not running now. Is there a way I could find the details of that process? (atleast the name of the process). Please let me know. (2 Replies)
Discussion started by: vijay.d
2 Replies

7. Shell Programming and Scripting

Check process running Status with PID

Good day I am fairly new to Shell Scripting. I want a script to check if a process is up by checking the process's PID and then return a value for when it's running which would be 0. If it isn't running it should give any other value that 0. Any Help is appreciated Regards (9 Replies)
Discussion started by: 1nsyz1on
9 Replies

8. Shell Programming and Scripting

kill PID running in background in for loop

Guys, can you help me in killing the process which is running in back ground under for loop I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Discussion started by: mohan_xunil
1 Replies

9. UNIX for Dummies Questions & Answers

Common UID's and PID's

Hey Folks, I'm a newbie to Unix. Sorry if this doubt sounds very silly. I know that first 100 UID's are used by system accounts and the rest, for normal users. It'd be great if someone could guide me to a link where i can browse through the list of 100 system managed accounts with their UID's.... (2 Replies)
Discussion started by: prithvirao17
2 Replies

10. Shell Programming and Scripting

Quick question about finding the PID of long-running processes

The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Discussion started by: Bolanok
2 Replies
ARRAY_DIFF_UKEY(3)							 1							ARRAY_DIFF_UKEY(3)

array_diff_ukey - Computes the difference of arrays using a callback function on the keys for comparison

SYNOPSIS
array array_diff_ukey (array $array1, array $array2, [array $...], callable $key_compare_func) DESCRIPTION
Compares the keys from $array1 against the keys from $array2 and returns the difference. This function is like array_diff(3) except the comparison is done on the keys instead of the values. Unlike array_diff_key(3) a user supplied callback function is used for the indices comparison, not internal function. PARAMETERS
o $array1 - The array to compare from o $array2 - An array to compare against o $... - More arrays to compare against o $key_compare_func - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. int callback (mixed $a, mixed $b) RETURN VALUES
Returns an array containing all the entries from $array1 that are not present in any of the other arrays. EXAMPLES
Example #1 array_diff_ukey(3) example <?php function key_compare_func($key1, $key2) { if ($key1 == $key2) return 0; else if ($key1 > $key2) return 1; else return -1; } $array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); var_dump(array_diff_ukey($array1, $array2, 'key_compare_func')); ?> The above example will output: array(2) { ["red"]=> int(2) ["purple"]=> int(4) } NOTES
Note This function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using array_diff_ukey($array1[0], $array2[0], 'callback_func');. SEE ALSO
array_diff(3), array_udiff(3), array_diff_assoc(3), array_diff_uassoc(3), array_udiff_assoc(3), array_udiff_uassoc(3), array_diff_key(3), array_intersect(3), array_intersect_assoc(3), array_intersect_uassoc(3), array_intersect_key(3), array_intersect_ukey(3). PHP Documentation Group ARRAY_DIFF_UKEY(3)
All times are GMT -4. The time now is 03:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy