Sponsored Content
Full Discussion: Kill command
Top Forums UNIX for Dummies Questions & Answers Kill command Post 302894199 by rbatte1 on Monday 24th of March 2014 10:39:29 AM
Old 03-24-2014
A very harsh way to learn is the difference between kill %1 and kill 1

This should be fine:-
Code:
# sleep 100 &
[1]     5638
# jobs
[1] +  Running                 sleep 100 &
# ps -f
     UID   PID    PPID  C    STIME TTY       TIME COMMAND
    root 17654   17653  0 13:33:49 pts/tv    0:00 -ksh
    root 5638    17654  0 14:28:48 pts/tv    0:00 sleep 100
    root 5840    17654  1 14:29:27 pts/tv    0:00 ps -f
    root 17653   986    0 13:33:49 pts/tv    0:00 telnetd -b /etc/herald
# kill %1
[1] + Terminated               sleep 100 &
#

I need to make this next bit clear:-
Do not run this!
Code:
# sleep 100 &
[1]     5638
# jobs
[1] +  Running                 sleep 100 &
# ps -f
     UID   PID    PPID  C    STIME TTY       TIME COMMAND
    root 17654   17653  0 13:33:49 pts/tv    0:00 -ksh
    root 5638    17654  0 14:28:48 pts/tv    0:00 sleep 100
    root 5840    17654  1 14:29:27 pts/tv    0:00 ps -f
    root 17653   986    0 13:33:49 pts/tv    0:00 telnetd -b /etc/herald
# kill 1
.
.
.

.... or your server with fail in the instant. Not even a crash in most cases, it just fails.

Even process 5 may be very early and a very critical process. You may be lucky and process 5 may have already terminated, but it's very risky stuff all the same. If you are the root user, you can terminate any process, so single digit errors on a kill command can be catastrophic. Imagine terminating an application serving process, a database query or worse a critical database service sudo as pmon for Oracle or oinit for Informix etc.


With great power comes great responsibility and errors can cause irrevocable damage.


Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

kill command

what is the kill command? (1 Reply)
Discussion started by: Rush
1 Replies

2. Programming

the kill command

is it possible to implement the kill command using C? (2 Replies)
Discussion started by: kelogs1347
2 Replies

3. UNIX for Dummies Questions & Answers

Kill Command

Hi All, What is difference between kill & kill -9 command? Thanks & regards, Sonali (4 Replies)
Discussion started by: sonali
4 Replies

4. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

5. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

6. Shell Programming and Scripting

kill command issues

xxxxxx (8 Replies)
Discussion started by: kitty123
8 Replies

7. Solaris

Help with Kill Command

I am running Solaris 9. I have a problem with kill command. I'm sort of teaching myself so this might be a really stupid thing. I logged in as a normal user, lets say ABC, and then did "su" to root. After becoming root, I tried to kill the process started by ABC by saying kill -9 "pid of ABC" ... (3 Replies)
Discussion started by: the_red_dove
3 Replies

8. Shell Programming and Scripting

kill command

Good way to kill the process, if the process having it's child (3 Replies)
Discussion started by: pritish.sas
3 Replies

9. Shell Programming and Scripting

kill command in linux OS

How to undo the kill command in Linux OS? (9 Replies)
Discussion started by: poonam.gaigole
9 Replies

10. Shell Programming and Scripting

kill using the ps command

hello, can anyone help me with a script that checks the status of processes and "kills" the process that's hanging? I mean I'm aware of the commands but I'm confused on how to put them all together... thanks! :) (4 Replies)
Discussion started by: dude911
4 Replies
PTS_SLEEP(1)						       AFS Command Reference						      PTS_SLEEP(1)

NAME
pts_sleep - Pauses for a few seconds SYNOPSIS
pts sleep [-delay] <# of seconds> [-cell] <cell name> [-noauth] [-localauth] [-force] pts sl [-d] <# of seconds> [-c] <cell name> [-n] [-l] [-f] DESCRIPTION
The pts sleep pauses for a specified number of seconds. The command can be run from the command line or interactively, although from the command line it's essentially equivalent to the sleep command. It is intended for use in interactive mode to pause for a few seconds between batch commands to allow the Protection Server to catch up. CAUTIONS
Prior to OpenAFS 1.4.5 and OpenAFS 1.5.23, the pts sleep command was only available on Unix or Linux and when OpenAFS was compiled with the supergroups option (disabled by default). As of OpenAFS 1.4.5 and 1.5.23, it is always available. OPTIONS
Although they have no effect, pts sleep takes the following standard pts options: -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). OUTPUT
This command produces no output. EXAMPLES
Here is an example of a pts interactive session: % pts interactive pts> sleep 5 pts> quit % SEE ALSO
pts(1), pts_interactive(1) COPYRIGHT
Copyright 2007 Jason Edgecombe <jason@rampaginggeek.com> This documentation is covered by the BSD License as written in the doc/LICENSE file. This man page was written by Jason Edgecombe for OpenAFS. OpenAFS 2014-04-08 PTS_SLEEP(1)
All times are GMT -4. The time now is 12:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy