修改了/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 根目录
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步