kwing

登录linux时 shell执行顺序

# .bash_history,.bash_logout,.bash_profile,.bashrc
/etc/profile 全局
.bash_history 记录当前登录用户历史操作的命令
.bash_logout 当前用户登出时执行的命令
.bash_profile 交互式登录时执行的内容
.bashrc 非交互式登录执行的内容

举例:
root用户切换到oracle用户
# 1.交互式登录,shell执行顺序:su - oracle
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile
# 2.非交互式登录,shell执行顺序: su oracle
/etc/bashrc
~/.bashrc

因此当出现类似于下面错误时,应该考虑切换用户登录的方式

 lsnrctl status
bash: lsnrctl: command not found

 

posted on 2019-09-12 14:27  kwing  阅读(531)  评论(0编辑  收藏  举报

导航

返回顶部
>>
<<