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

개요

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

limit(1)

limit(1)                         User Commands                        limit(1)

NAME
       limit, ulimit, unlimit - set or get limitations on the system resources
       available to the current shell and its descendents

SYNOPSIS
       /usr/bin/ulimit [-HSacdfmnpstv] [limit]

   /usr/sunos/bin/sh
       ulimit [- [HS] [a | cdfnstv]]


       ulimit [- [HS] [c | d | f | n | s | t | v]] limit

   csh
       limit [-h] [resource [limit]]


       unlimit [-h] [resource]

   ksh88
       ulimit [-HSacdfnstv] [limit]

   ksh
       ulimit [-HSacdfmnpstv] [limit]

   bash
       ulimit [-SHabcdefilmnpqrstuvxT] [limit]

DESCRIPTION
   /usr/bin/ulimit
       The standalone command /usr/bin/ulimit is identical to the ksh built-in
       version  described below, except that it is run in a new shell instance
       that exits as soon as the command completes, so that any  changes  made
       to  limits  are not inherited by any other processes, unlike the normal
       method of new limits applying to all further processes started from the
       shell in which the built-in command is run.

   /usr/sunos/bin/sh
       The Bourne shell built-in function, ulimit, prints or sets hard or soft
       resource limits. These limits are described in getrlimit(2).


       If limit is not present, ulimit prints the specified limits. Any number
       of limits can be printed at one time. The -a option prints all limits.


       If limit is present, ulimit sets the  specified  limit  to  limit.  The
       string  unlimited  requests that the current limit, if any, be removed.
       Any user can set a soft limit to any value less than or  equal  to  the
       hard  limit.  Any  user can lower a hard limit. Only a process with the
       {PRIV_SYS_RESOURCE} privilege can raise or remove  a  hard  limit.  See
       getrlimit(2).


       The  -H  option  specifies a hard limit. The -S option specifies a soft
       limit. If neither option is specified,  ulimit  sets  both  limits  and
       prints the soft limit.


       The  following  options  specify  the  resource  whose limits are to be
       printed or set. If no option is  specified,  the  file  size  limit  is
       printed or set.

       -c    Maximum core file size (in 512-byte blocks)


       -d    Maximum size of data segment or heap (in Kbytes)


       -f    Maximum file size (in 512-byte blocks)


       -n    Maximum file descriptor plus 1


       -s    Maximum size of stack segment (in Kbytes)


       -t    Maximum CPU time (in seconds)


       -v    Maximum size of virtual memory (in Kbytes)


   csh
       The  C-shell  built-in  function,  limit, limits the consumption by the
       current process or any process it spawns, each not to exceed  limit  on
       the  specified resource. The string unlimited requests that the current
       limit, if any, be removed. If limit  is  omitted,  prints  the  current
       limit. If resource is omitted, displays all limits.

       -h    Use hard limits instead of the current limits. Hard limits impose
             a  ceiling  on  the  values of the current limits. Only a process
             with the {PRIV_SYS_RESOURCE} privilege can raise the hard limits.



       resource is one of:

       cputime         Maximum CPU seconds per process.


       filesize        Largest single file allowed. Limited to the size of the
                       filesystem and  capabilities  of  the  filesystem.  See
                       df(8).


       datasize        The maximum size of a process's heap in kilobytes.


       stacksize       Maximum  stack  size for the process. The default stack
                       size is 2^13.


       coredumpsize    Maximum size of a core dump file.


       descriptors     Maximum number of file descriptors. See Intro(2).


       memorysize      Maximum size of virtual memory.



       limit is a number, with an optional scaling factor, as follows:

       nh       Hours (for cputime).


       nk       n kilobytes. This is the default for all but cputime.


       nm       n megabytes or minutes (for cputime).


       mm:ss    Minutes and seconds (for cputime).



       unlimit removes a limitation on resource. If no resource is  specified,
       then  all  resource limitations are removed. See the description of the
       limit command for the list of resource names.

       -h    Remove  corresponding  hard  limits.  Only  a  process  with  the
             {PRIV_SYS_RESOURCE} privilege can do this.


   ksh88
       The  Korn  shell built-in function, ulimit, sets or displays a resource
       limit. The available resources limits are listed below. Many systems do
       not contain one or more of these limits. The limit for a specified  re‐
       source is set when limit is specified. The value of limit can be a num‐
       ber in the unit specified below with each resource, or the value unlim‐
       ited.  The string unlimited requests that the current limit, if any, be
       removed. The -H and -S flags specify whether the hard limit or the soft
       limit for the specified resource is set. A hard  limit  cannot  be  in‐
       creased  once  it is set. A soft limit can be increased up to the value
       of the hard limit. If neither the -H or -S options  is  specified,  the
       limit applies to both. The current resource limit is printed when limit
       is omitted. In this case, the soft limit is printed unless -H is speci‐
       fied. When more than one resource is specified, then the limit name and
       unit is printed before the value.

       -a    Lists all of the current resource limits.


       -c    The number of 512-byte blocks on the size of core dumps.


       -d    The number of K-bytes on the size of the data area.


       -f    The number of 512-byte blocks on files written by child processes
             (files of any size can be read).


       -n    The number of file descriptors plus 1.


       -s    The number of K-bytes on the size of the stack area.


       -t    The number of seconds (CPU time) to be used by each process.


       -v    The number of K-bytes for virtual memory.



       If no option is specified, -f is assumed.

   ksh
       ulimit sets or displays resource limits. These limits apply to the cur‐
       rent process and to each child process created after the resource limit
       has  been set. If limit is specified, the resource limit is set, other‐
       wise, its current value is displayed on standard output.


       Increasing the limit for a resource  usually  requires  special  privi‐
       leges.  Some  systems  allow you to lower resource limits and later in‐
       crease them. These are called soft limits. Once a hard  limit  is  set,
       the soft limit for the resource cannot be increased past that limit.


       Different systems allow you to specify different resources and some re‐
       strict how much you can raise the limit of the resource.


       The  value of limit depends on the unit of the resource listed for each
       resource. In addition, limit can be "unlimited" to  indicate  no  limit
       for that resource.


       If you do not specify -H or -S, -S is used for listing, and both -S and
       -H are used for setting resources.


       If you do not specify any resource, the default is -f.


       The following options are available for ulimit in ksh:

       -a           Displays all current resource limits.


       -b           Specifies the socket buffer size in bytes.
       --sbsize


       -c           Specifies the core file size in blocks.
       --core


       -d           Specifies the data size in kbytes.
       --data


       -f           Specifies the file size in blocks.
       --fsize


       -H           Displays or sets a hard limit.


       -L           Specifies the number of file locks.
       --locks


       -l           Specifies the locked address space in Kbytes.
       --memlock


       -M           Specifies the address space limit in Kbytes.
       --as


       -n           Specifies the number of open files.
       --nofile


       -p           Specifies the pipe buffer size in bytes.
       --pipe


       -m           Specifies the resident set size in Kbytes
       --rss


       -S           Displays or sets a soft limit.


       -s           Specifies the stack size in Kbytes.
       --stack


       -T           Specifies the number of threads.
       --threads


       -t           Specifies the CPU time in seconds.
       --cpu


       -u           Specifies the number of processes.
       --nproc


       -v           Specifies the process size in Kbytes.
       --vmem


   bash
       The  bash  ulimit  function uses different units for the core file (-c)
       and file size (-f) limits than other ulimit implementations.  The  bash
       shell  uses  block  size  1024b  while  other  implementations use 512b
       blocks. This has to be taken into account when you write a  code  which
       is  to be executed by different shells, like /etc/profile. For more in‐
       formation about the documentation of bash built-in function ulimit, see
       the bash(1) man page.

OPTIONS
       The following option is supported by /usr/bin/ulimit:

       -f    Sets (or reports, if no blocks operand is present), the file size
             limit in blocks. The -f option is also the default case.


OPERANDS
       The following operand is supported by /usr/bin/ulimit:

       blocks    The number of 512-byte blocks to use as  the  new  file  size
                 limit.


EXAMPLES
   /usr/sunos/bin/sh or ksh88
       Example 1 Limiting the Stack Size



       The following example limits the stack size to 512 kilobytes:


         example% ulimit -s 512
         example% ulimit -a
         time(seconds)         unlimited
         file(blocks)            100
         data(kbytes)            523256
         stack(kbytes)           512
         coredump(blocks)        200
         nofiles(descriptors)    64
         memory(kbytes)          unlimited


       Example 2 Limiting the Number of File Descriptors



       The following command limits the number of file descriptors to 12:


         example$ ulimit -n 12
         example$ ulimit -a
         time(seconds)            unlimited
         file(blocks)             41943
         data(kbytes)             523256
         stack(kbytes)            8192
         coredump(blocks)         200
         nofiles(descriptors)     12
         vmemory(kbytes)          unlimited


   csh
       Example 3 Limiting the Core Dump File Size



       The  following  command  limits  the size of a core dump file size to 0
       kilobytes:


         example% limit coredumpsize 0
         example% limit
         cputime                 unlimited
         filesize                unlimited
         datasize                523256 kbytes
         stacksize               8192 kbytes
         coredumpsize            0 kbytes
         descriptors             64
         memorysize              unlimited


       Example 4 Removing the limitation for core file size



       The following command removes the above limitation for  the  core  file
       size:


         example% unlimit coredumpsize
         example% limit
         cputime                 unlimited
         filesize                unlimited
         datasize                523256 kbytes
         stacksize               8192 kbytes
         coredumpsize            unlimited
         descriptors             64
         memorysize              unlimited


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

EXIT STATUS
       The following exit values are returned by ulimit:

       0      Successful completion.


       > 0    A request for a higher limit was rejected or an error occurred.


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

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



       See the respective shell man pages for attributes of the shell built-in
       command versions of limit and ulimit.

SEE ALSO
       bash(1), csh(1), ksh(1), ksh88(1),  plimit(1),  prctl(1),  sh(1s),  In‐
       tro(2),  getrlimit(2), attributes(7), environ(7), resource-controls(7),
       privileges(7), standards(7), df(8), su(8), swap(8)

NOTES
       Be aware of possible unexpected consequences when using ulimit in  con‐
       junction   with  other  Solaris  resource-limiting  features,  such  as
       prctl(1). See resource-controls(7).


       With the use of the project resource controls  described  in  resource-
       controls(7),  you should use prctl(1) to get an accurate observation of
       the limits in effect at any given time.

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