ITeye博客

su导致bash: xxxxxx: command not found解决 (2012-03-12 18:02:19)a

bluedest · 2012-05-15 11:43 · linux · Web前端 · Markdown

现象:

 

 

 

1.登录root账号,使用adduser testuser和passwd testuser新建用户

2.su testuser到新账号下,使用任何命令都显示bash: datestamp_for_history: command not found

 

 

 

原因:

 

 

 

1.su   只能切换用户权限,不使用原用户的登陆脚本和搜索路径 

2.su - 不但能切换用户权限,还能使用原用户的登陆脚本和搜索路径

之前是在root账号下直接SU切换到testuser用户。

 

 

解决:

 

 

 

退出换成SU - 再切换到testuser用户就好了。

使用su - 环境变量也跟着来啦~

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。