I am learning about ulimit right now and this is a bit confusing.
I start with this as my default ulimit.
test@ubuntu:~$ ulimit -n
1024
I can see my hard and soft limit:
test@ubuntu:~$ ulimit -Sn
1024
test@ubuntu:~$ ulimit -Hn
65536
If I do the below I set the ulimit to my hard limit.
test@ubuntu:~$ ulimit -n hard
test@ubuntu:~$ ulimit -n
65536
But if I try to change it to my soft limit it doesn't work. It is still hard.
test@ubuntu:~$ ulimit -n soft
test@ubuntu:~$ ulimit -n
65536
I have two questions:
- Why can't I lower it back to the soft limit.
What is the difference between these two below? One shows me unlimited the other shows 1024. (I started a new shell to be sure.)
test@ubuntu:~$ ulimit
unlimited
test@ubuntu:~$ ulimit -n 1024
Running Ubuntu15 Desktop edition with the default bash environment.
Thanks
maybe useful? maybe because you are non-root?
gives this amongst other: