How do I set all ulimits unlimited for all users?

2019-07-19 16:28发布

问题:

Yes, I want to remove all ulimits and set them to unlimited. How do I do this? Thanks!

回答1:

Use something like this:

 for opt in $(ulimit -a | sed 's/.*\-\([a-z]\)[^a-zA-Z].*$/\1/'); do
     ulimit -$opt ulimited
 done

Caution, check output of ulimit -a | sed 's/.*\-\([a-z]\)[^a-zA-Z].*$/\1/' first, ulimit -a output may differ from system to system.