I used the cat /proc/<pid>/limits command to check the Max open file hard and soft limit, but I want to know how this value will be set and can it be increased or decreased?

Is this value is set in some configuration file?

I tried ulimit command, but that is not helpful to set limit of specific process.

# ulimit -n 2048

But still i am seeing 1024 in

# cat /proc/<pid>/limits
Max open files            1024                 4096                 files

I know similar questions are asked but, i can't find any better answer.

  • the ulimit shell built-in can show current limits or set limits for the current process (shell) and all subsequent child processes only. It can't be used to change limits for already running processes (e.g. system daemons, programs started previously from the current shell or at any time from other shells or started by cron or inetd etc).
    – cas
    Commented Apr 27, 2016 at 8:40

2 Answers 2


If you have the util-linux package installed, you set hard and soft limits for a particular process using the prlimit command. To set the soft and hard limits for maximum number of open files to 10 and 20, respectively, for a command command, run:

prlimit -n10:20 command

Arguments for the command can be provided as well:

prlimit -n10:20 command arg1 arg2 ...

For much more information, see man prlimit.

Note: unlike many other Unix commands, prlimit permits no space between an option and its argument. Thus -n10:20 works but -n 10:20 does not.


If we're talking about a daemon, you can supply ulimt -n $your_number in the init script. If it is an already running process and you cannot restart it use prlimit like John1024 proposed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .