LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 559|回复: 2

su问题

[复制链接]
发表于 2005-3-7 09:44:00 | 显示全部楼层 |阅读模式
su - root(回车),然后输入密码
后,为什么ifconfig出错
-bash: /bin/ifconfig: cannot execute binary file

而直接su(回车),然后输入密码
就可以用ifconfig

请问su的这两种用法存在什么区别?
发表于 2005-3-7 12:14:50 | 显示全部楼层
ifconfig is located at /sbin, not /bin!

With su, root will login the current working directory under a root shell.

With su -, root will login root's own directory in root's own shell.
回复 支持 反对

使用道具 举报

发表于 2005-3-7 12:17:51 | 显示全部楼层
su  只将身份切换到root ,当前用户环境变量为
su - 将身份切换到root,环境变量切换到root 的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表