sudo: ulimit: command not found

简介:

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.

sudo 查看ulimit报错:
google 百度,翻译都太拗口,简洁的说:

ulimit是一个shell内置的命令 像cd ,不是一个独立的进程,sudo以二进制方式运行,但是没有ulimit的二进制方式,所以你运行错误。 应该在一个shell中运行。

本文转自    憬薇   51CTO博客,原文链接:http://blog.51cto.com/welcomeweb/2044982


相关文章
|
Ubuntu
Ubuntu的中文乱码问题
Ubuntu的中文乱码问题
1034 2
|
网络协议 Linux
Centos IP、DNS设置
1、CentOS 修改DNS 修改对应网卡的DNS的配置文件# vi /etc/resolv.conf 修改以下内容 nameserver 8.8.8.8 #google域名服务器nameserver 8.8.4.4 #google域名服务器2、CentOS 修改网关 修改对应网卡的网关的配置文件[root@centos]# vi /etc/sysconfig/network 修改以下内容NETWORKING=yes(表示系统是否使用网络,一般设置为yes。
3423 0
|
9月前
|
网络协议 数据安全/隐私保护 网络架构
|
6月前
|
传感器 定位技术 数据格式
常用通信协议及数据格式
常用通信协议和格式总结
523 3
Notepad++怎么对比文件,安装文件对比插件Compare plugin
Notepad++怎么对比文件,安装文件对比插件Compare plugin
3782 2
|
存储 NoSQL Linux
《探索 Linux 命令:systemd-coredumpctl》
**《systemd-coredumpctl概览》** `systemd-coredumpctl`, Linux中管理&分析core dump的利器。集中管控systemd生成的转储,详述crash细节。用`--list`查看所有转储,`--info <ID>`深入单一转储。需注意权限、存储管理,配gdb深化分析。精通此命令,加速问题诊断。#LinuxTips #CoreDumpAnalysis
network is not ready: runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady me
network is not ready: runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady me
515 1
|
存储 监控 安全
Android
Android
|
机器学习/深度学习 存储 算法
Faiss为啥这么快?原来是量化器在做怪!1
Faiss为啥这么快?原来是量化器在做怪!
1416 0
|
编译器 C语言 C++
CMake基础(9)使用Clang编译
CMake基础(9)使用Clang编译
1545 0

热门文章

最新文章