linux - 为什么每次进入命令都要重新source /etc/profile 才能生效?

root用户登录,vim ~/.bashrc 添加source /etc/profile 然后就ok了

~/.bashrc 命令的意思:

~/是进入当前用户的主目录
cd ~/   就进入了/home/aaa 目录。
.bashrc 是进入.bashrc文件夹,就是用户目录下的名字是.bashrc的目录。

.bashrc 的确是在 /root 目录下。. 开头的文件指的是隐藏文件

dcloud-dev-paas-meas02:~ # ls -al
总用量 144
drwxrwxrwx 11 root root  4096  7月  9 01:36 .
drwxr-xr-x 22 root root  4096  5月 28 06:10 ..
-rw-------  1 root root 30398  7月  9 01:36 .bash_history
-rw-r--r--  1 root root    25  5月 26 10:37 .bash_logout
-rw-r--r--  1 root root  1276  7月  9 01:36 .bashrc
-rw-r--r--  1 root root  1254  5月 26 10:37 .bashrc~
-rw-r--r--  1 root root    71  7月  7 09:39 .DCOPserver_dcloud-dev-paas-meas02__0
lrwxrwxrwx  1 root root    43  7月  7 09:39 .DCOPserver_dcloud-dev-paas-meas02_:0 -> /root/.DCOPserver_dcloud-dev-paas-meas02__0
-rw-r--r--  1 root root    56  5月 28 06:06 .DCOPserver_localhost__0
lrwxrwxrwx  1 root root    30  5月 28 06:06 .DCOPserver_localhost_:0 -> /root/.DCOPserver_localhost__0
-rw-r--r--  1 root root    64  5月 26 10:55 .DCOPserver_localhost.in.linx__0
lrwxrwxrwx  1 root root    38  5月 26 10:55 .DCOPserver_localhost.in.linx_:0 -> /root/.DCOPserver_localhost.in.linx__0
drwxr-xr-x  2 root root  4096  5月 26 10:55 Desktop
-rw-------  1 root root    26  5月 26 10:55 .dmrc
-rw-r--r--  1 root root    24  5月 26 10:44 .gitconfig
-rw-------  1 root root   629  7月  7 09:39 .ICEauthority
dr-xr-xr-x  4 root root  4096  7月  7 09:39 .kde
drwx------  3 root root  4096  5月 26 10:55 .local
drwxr-xr-x  3 root root  4096  5月 26 10:55 .mcop
drwxr-xr-x  2 root root  4096  7月  7 02:51 .oracle_jre_usage
-rw-r--r--  1 root root   315  5月 26 10:37 .profile
drwxr-xr-x  3 root root  4096  5月 26 10:55 .python-eggs
drwxr-xr-x  2 root root  4096  7月  7 09:39 .qt
-rw-------  1 root root  1409  7月  8 09:19 .rediscli_history
drwx------  4 root root  4096  5月 26 11:02 .scim
drwx------  2 root root  4096  5月 26 10:44 .ssh
-rw-------  1 root root  6046  7月  9 01:36 .viminfo
-rw-------  1 root root   541  7月  9 01:36 .Xauthority
-rw-r--r--  1 root root    65  5月 26 10:44 .xinitrc
-rw-------  1 root root  1342  7月  7 09:40 .xsession-errors

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值