10年 Java程序员,硬核人生!勇往直前,永不退缩!

欢迎围观我的git:https://github.com/R1310328554/spring_security_learn 寻找志同道合的有志于研究技术的朋友,关注本人微信公众号: 觉醒的码农,或Q群 165874185

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

修改了/root/下的.bashrc

-bash-4.1# vi .bashrc

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


if [ -f ~/bash_aliases ]; then
. ~/bash_aliases
elif [ -f bash_aliases ]; then
. bash_aliases
else
echo " no bash_aliases found !"
fi

~

 

/etc/下的 bashrc 

文末尾增加


if [ -f bash_aliases ]; then
    . /etc/bash_aliases;
   echo " 1111111 aasb";
fi    
 

 

或者修改/etc/profile,

 

执行 .  bashrc 或 . .bashrc 或通过source执行(会有echo信息), 只能在当前shell生效, 新开的shell就不行(没有echo信息)!reboot 重启都不行!

 

———— 可能是因为我修改了/root 根目录的缘故吧。。。

 

后面在 /etc/profile.d/ 增加一个sh脚本, 就可以了!,每次新开shell窗口都会有echo !

 

参考

http://blog.csdn.net/chenchong08/article/details/7833242 —— 这里其实说的不准确,当修改了/root 根目录

 

posted on 2015-08-08 18:40  CanntBelieve  阅读(1373)  评论(0编辑  收藏  举报