Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4011384
  • 博文数量: 626
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 11080
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-23 13:08
文章分类

全部博文(626)

文章存档

2015年(72)

2014年(48)

2013年(506)

分类: LINUX

2014-03-13 11:31:33

Ubuntu解决sudo: source: command not found错误

在Ubuntu Server上执行以下命令,可以看到默认打开的文件数限制为1024个。

$ ulimit -n

1024
编辑/etc/profile配置文件,在最后添加一行:
ulimit -SHn 65535
要让配置生效:

$ sudo source /etc/profile

sudo: source: command not found

我们直接执行ulimit -SHn 65535命令又会怎么样呢?

$ ulimit -SHn 65535

-bash: ulimit: open files: cannot modify limit: Operation not permitted
$ sudo ulimit -SHn 65535
sudo: ulimit: command not found

普通用户获得root权限后反而提示找不到命令了,该如何解决这个问题呢?

正确的方法如下:

$ sudo -s

# source /etc/profile
再次执行ulimit,可以看到打开文件的限制数已改为65535了。

# ulimit -n

65535






阅读(7173) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~