delete all PID that running by UID ??


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users delete all PID that running by UID ??
# 1  
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
# 2  
Old 01-18-2009
Quote:
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:
ps -ef|grep <USERNAME>|grep -v grep|awk '{print $2}'|xargs kill 
#you could use -9 but start gracefully...#

All the best
# 3  
Old 01-18-2009
su purple
/usr/bin/kill -15 -1

When pid is -1 kill will atomically signal all processes owned by the user.
# 4  
Old 01-18-2009
The column headed "C" is the task priority (0-255).
A high number is a low priority.
You may see unix change a task priority dynamically to 200+ if a task might
be looping.
# 5  
Old 01-19-2009
Quote:
Originally Posted by methyl
The column headed "C" is the task priority (0-255).
A high number is a low priority.
You may see unix change a task priority dynamically to 200+ if a task might
be looping.
Thanks buddy.
# 6  
Old 01-19-2009
You can also use the pkill utility if it is available on your platform. man pkill.
# 7  
Old 01-20-2009
Quote:
Originally Posted by fpmurphy
You can also use the pkill utility if it is available on your platform. man pkill.
yes pkill is available in my solaris.

so what will be the syntax then to kill process which UID is purple?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question