kill(1) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

kill(1)

kill(1)                          User Commands                         kill(1)

NAME
       kill - terminate or signal processes

SYNOPSIS
       /usr/bin/kill -s signal_name pid...


       /usr/bin/kill -l [exit_status]


       /usr/bin/kill [-signal_name] pid...


       /usr/bin/kill [-signal_number] pid...

DESCRIPTION
       The  kill  utility sends a signal to the process or processes specified
       by each pid operand.


       For each pid operand, the kill utility performs actions  equivalent  to
       the kill(2) function called with the following arguments:

           1.     The value of the pid operand is used as the pid argument.


           2.     The  sig  argument  is the value specified by the -s option,
                  the -signal_name option, or the -signal_number  option,  or,
                  if none of these options is specified, by SIGTERM.




       The signaled process must belong to the current user unless kill is run
       with  the {PRIV_PROC_OWNER} privilege, as may be done using the Process
       Management rights profile.


       See NOTES for descriptions of the shell built-in versions of kill.

OPTIONS
       The following options are supported:

       -l                (The letter ell.) Writes all  values  of  signal_name
                         supported  by  the  implementation,  if no operand is
                         specified. If an exit_status operand is specified and
                         it is a value of the ? shell  special  parameter  and
                         wait  corresponding  to a process that was terminated
                         by a signal, the  signal_name  corresponding  to  the
                         signal  that terminated the process is written. If an
                         exit_status operand is specified and it  is  the  un‐
                         signed  decimal integer value of a signal number, the
                         signal_name corresponding to that signal is  written.
                         Otherwise, the results are unspecified.


       -s signal_name    Specifies  the  signal to send, using one of the sym‐
                         bolic names defined in  the  <signal.h>  description.
                         Values  of signal_name are recognized in a case-inde‐
                         pendent fashion, without the SIG prefix. In addition,
                         the symbolic name 0 is recognized,  representing  the
                         signal  value  zero. The corresponding signal is sent
                         instead of SIGTERM.


       -signal_name      Equivalent to -s  signal_name.


       -signal_number    Specifies a non-negative decimal integer, signal_num‐
                         ber, representing the signal to be  used  instead  of
                         SIGTERM, as the sig argument in the effective call to
                         kill(2).


OPERANDS
       The following operands are supported:

       pid            One of the following:


                          1.     A  decimal  integer  specifying  a process or
                                 process group to be signaled. The process  or
                                 processes  selected by positive, negative and
                                 zero values of the  pid  operand  is  as  de‐
                                 scribed  for  the  kill  function. If process
                                 number 0 is specified, all processes  in  the
                                 process  group are signaled. If the first pid
                                 operand is negative, it should be preceded by
                                 −− to keep it from being  interpreted  as  an
                                 option.


                          2.     A  job control job ID that identifies a back‐
                                 ground process group to be signaled. The  job
                                 control  job  ID  notation is applicable only
                                 for invocations of kill in the current  shell
                                 execution environment.


                      The  job control job ID type of pid is available only on
                      systems supporting the job control option.


       exit_status    A decimal integer specifying a signal number or the exit
                      status of a process terminated by a signal.


USAGE
       Process numbers can be found by using ps(1).


       The job control job ID notation is not required  to  work  as  expected
       when kill is operating in its own utility execution environment. In ei‐
       ther of the following examples:

         example% nohup kill %1 &


         system("kill %1");



       kill operates in a different environment and does not share the shell's
       understanding of job numbers.

OUTPUT
       When  the  -l  option  is  not specified, the standard output is not be
       used.


       When the -l option is specified, the symbolic name of  each  signal  is
       written in the following format:

         "%s%c", <signal_name>, <separator>



       where  the  <signal_name>  is in uppercase, without the SIG prefix, and
       the <separator> is either a newline character or a space character. For
       the last signal written, <separator> is a newline character.


       When both the -l option and exit_status operand are specified, the sym‐
       bolic name of the corresponding signal is written in the following for‐
       mat:

         "%s\n", <signal_name>


EXAMPLES
       Example 1 Sending the kill signal



       Any of the commands:


         example% kill -9 100 -165
         example% kill -s kill 100 -165
         example% kill -s KILL 100 -165




       sends the SIGKILL signal to the process whose process ID is 100 and  to
       all  processes  whose  process  group  ID  is 165, assuming the sending
       process has permission to send that signal to the specified  processes,
       and that they exist.

       Example 2 Avoiding ambiguity with an initial negative number



       To avoid an ambiguity of an initial negative number argument specifying
       either  a signal number or a process group, the former is always be the
       case. Therefore, to send the default signal to a process group (for ex‐
       ample, 123), an application should use a command similar to one of  the
       following:


         example% kill -TERM -123
         example% kill -- -123


ENVIRONMENT VARIABLES
       See  environ(7) for descriptions of the following environment variables
       that affect the execution of kill: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
       and NLSPATH.

EXIT STATUS
       The following exit values are returned:

       0      If -l was not specified, at least one matching process was found
              for each pid operand, and the specified signal was  successfully
              processed for at least one matching process.

              If  -l  was  specified, any arguments were valid, and the output
              was successfully written to standard output.


       > 0    An error occurred.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

   /usr/bin/kill
       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE  _  Availabilitysystem/core-os  _ CSIEnabled _ Interface
       StabilityCommitted _ StandardSee standards(7).



       See the respective shell man pages for attributes of the shell built-in
       command versions of kill.

SEE ALSO
       csh(1),  getconf(1),   jobs(1),   ksh(1),   ksh88(1),   ps(1),   sh(1),
       shell_builtins(1),  wait(1),  kill(2), signal(3C), signal.h(3HEAD), at‐
       tributes(7), environ(7), privileges(7), standards(7)

NOTES
   /usr/bin/kill
       The number of realtime signals supported is defined by  the  getconf(1)
       value _POSIX_RTSIG_MAX.

   /usr/sunos/bin/sh
       The  Bourne shell, /usr/sunos/bin/sh, has a built-in version of kill to
       provide the functionality of the kill command for processes  identified
       with a jobid. The sh syntax is:

         kill [ -sig ] [ pid ] [ %job ]...
         kill -l


   /usr/sunos/bin/csh
       The  C-shell,  /usr/sunos/bin/csh,  also  has  a built-in kill command,
       whose syntax is:

         kill [-sig][pid][%job]...
         kill -l



       The csh  kill built-in sends the TERM (terminate) signal,  by  default,
       or  the  signal  specified,  to the specified process ID, the job indi‐
       cated, or the current job. Signals are either specified by number or by
       name. There is no default. Typing kill does not send a  signal  to  the
       current  job.  If  the  signal  being  sent  is TERM (terminate) or HUP
       (hangup), then the job or process is sent a CONT (continue)  signal  as
       well.

       -l    Lists the signal names that can be sent.


   ksh88
       The syntax of the ksh88  kill is:

         kill [-sig][pid][%job]...
         kill -l



       The  ksh88  kill sends either the TERM (terminate) signal or the speci‐
       fied signal to the specified jobs  or  processes.  Signals  are  either
       specified  by  number  or  by  names  (as  specified in signal.h(3HEAD)
       stripped of the SIG prefix). If the signal being sent is  TERM  (termi‐
       nate)  or  HUP  (hangup),  then the job or process is sent a CONT (con‐
       tinue) signal if it is stopped. The argument job can be the process  id
       of  a  process  that  is not a member of one of the active jobs. In the
       second form, kill  -l, the signal numbers and names are listed.

   ksh
       The syntax of the ksh  kill is:

         kill [-n signum] [-s signame] job ...
         kill [-n signum] [-s signame] -l [arg ...]



       With the first form in which -l is not specified, kill sends  a  signal
       to one or more processes specified by job. This normally terminates the
       processes unless the signal is being caught or ignored.


       Specify job as one of the following:

       number      The process id of job.


       -number     The process group id of job.


       %number     The job number.


       %string     The job whose name begins with string.


       %?string    The job whose name contains string.


       %+          The current job.
       %%


       %-          The previous job.



       If the signal is not specified with either the -n or the -s option, the
       SIGTERM signal is used.


       If  -l is specified, and no arg is specified, then kill writes the list
       of signals to standard output. Otherwise, arg can be  either  a  signal
       name,  or  a  number representing either a signal number or exit status
       for a process that was terminated due to a signal. If a name is  speci‐
       fied, the corresponding signal number is written to standard output. If
       a number is specified the corresponding signal name is written to stan‐
       dard output.

       -l            List  signal  names or signal numbers rather than sending
                     signals as described above. The -n and -s options  cannot
                     be specified.


       -n signum     Specify  a  signal number to send. Signal numbers are not
                     portable across platforms, except for the following:

                     0     No signal.


                     1     HUP


                     2     INT


                     3     QUIT


                     6     ABRT


                     9     KILL


                     14    ALRM


                     15    TERM



       -s signame    Specify a signal name to send. The signal names  are  de‐
                     rived from their names in <signal.h> without the SIG pre‐
                     fix and are case insensitive. kill  -l generates the list
                     of signals on the current platform.



       kill in ksh exits with one of the following values:

       0      At  least  one  matching process was found for each job operand,
              and the specified signal was successfully sent to at  least  one
              matching process.


       > 0    An error occurred.


Oracle Solaris 11.4               29 Nov 2022                          kill(1)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3