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

最新文章

  1. wamp下Apache配置vhost
  2. ThinkPHP 错误: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'
  3. ping脚本
  4. Deep Learning 6_深度学习UFLDL教程:Softmax Regression_Exercise(斯坦福大学深度学习教程)
  5. log_reuse_wait_desc为REPLICATION,日志暴大,无法收缩
  6. 无法向会话状态服务器发出会话状态请求请。确保 ASP.NET State Service (ASP.NET 状态服务)已启动
  7. 手把手教你js原生瀑布流效果实现
  8. PHP curl之爬虫初步
  9. angular路由守卫
  10. Python练手例子(12)
  11. NPOI写Excel,Spire.XLS for.NET组件转换Excel为PDF
  12. Jquery DataTables 获取表格数据
  13. fedora更新
  14. kubernetes国内镜像拉取
  15. 如何在magento添加推荐分类
  16. 【实战项目】【FLEX】#900 实现拖控件功能
  17. 基于spring-boot的应用程序的单元测试方案
  18. Log4j输出格式控制
  19. JDK1.9怎么配置环境变量
  20. 20155320 2016-2017-2 《Java程序设计》第的四周学习总结

热门文章

  1. event.returnValue=false与event.preventDefault()
  2. reinterpret_cast and const_cast
  3. 如何进入百度、阿里,一个6年Android老司机的面经
  4. mysql case when使用记录
  5. Java并发(3)- 聊聊Volatile
  6. java equals 与 hashCode
  7. hdu 4089 概率dp
  8. [bzoj2301][HAOI2011]Problem B —— 莫比乌斯反演+容斥原理
  9. 蓝牙攻击指南(kali)
  10. python urllib2 常见请求方式