ulimit 不生效
2024-09-06 01:52:04
ulimit
is a shell builtin like cd
, not a separate program. sudo
looks for a binary to run, but there is no ulimit
binary, which is why you get the error message. You need to run it in a shell.
However, while you do need to be root to raise the limit to 65535, you probably don’t want to run your program as root. So after you raise the limit you should switch back to the current user.
To do this, run:
sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"
and you will get a new shell, without root privileges, but with the raised limit. The exec
causes the new shell to replace the process with sudo
privileges, so after you exit that shell, you won’t accidentally end up as root again.
https://stackoverflow.com/questions/17483723/command-not-found-when-using-sudo-ulimit
最新文章
- wamp下Apache配置vhost
- ThinkPHP 错误: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'
- ping脚本
- Deep Learning 6_深度学习UFLDL教程:Softmax Regression_Exercise(斯坦福大学深度学习教程)
- log_reuse_wait_desc为REPLICATION,日志暴大,无法收缩
- 无法向会话状态服务器发出会话状态请求请。确保 ASP.NET State Service (ASP.NET 状态服务)已启动
- 手把手教你js原生瀑布流效果实现
- PHP curl之爬虫初步
- angular路由守卫
- Python练手例子(12)
- NPOI写Excel,Spire.XLS for.NET组件转换Excel为PDF
- Jquery DataTables 获取表格数据
- fedora更新
- kubernetes国内镜像拉取
- 如何在magento添加推荐分类
- 【实战项目】【FLEX】#900 实现拖控件功能
- 基于spring-boot的应用程序的单元测试方案
- Log4j输出格式控制
- JDK1.9怎么配置环境变量
- 20155320 2016-2017-2 《Java程序设计》第的四周学习总结
热门文章
- event.returnValue=false与event.preventDefault()
- reinterpret_cast and const_cast
- 如何进入百度、阿里,一个6年Android老司机的面经
- mysql case when使用记录
- Java并发(3)- 聊聊Volatile
- java equals 与 hashCode
- hdu 4089 概率dp
- [bzoj2301][HAOI2011]Problem B —— 莫比乌斯反演+容斥原理
- 蓝牙攻击指南(kali)
- python urllib2 常见请求方式