修改CENTOS 环境变量

1. 之前发现PATH变量里有一部分路径有冗余,于是想恢复PATH,首先命令行下先执行以下命令

#PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

 

2. 重新source /etc/profile

#set Hadoop Environment
export HADOOP_HOME=/usr/local/hadoop-2.7.3
export HADOOP_PREFIX=/usr/local/hadoop-2.7.3
export HADOOP_CONF_DIR=/usr/local/hadoop-2.7.3/etc/hadoop
export HADOOP_CLASSPATH=/usr/local/hadoop-2.7.3/share/hadoop/common
export HIVE_HOME=/usr/local/apache-hive-1.2.1-bin

#set Java Environment
export JAVA_HOME=/usr/java/jdk1.8.0_73
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$HIVE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin:$HADOOP_CLASSPATH

 

3. 再观察path,消除冗余 

[root@master ~]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.8.0_73/bin:/usr/local/hadoop-2.7.3/bin:/usr/local/hadoop-2.7.3/sbin:/usr/local/apache-hive-1.2.1-bin/bin:/usr/local/hadoop-2.7.3/share/hadoop/common:/root/bin

 

posted @ 2016-11-16 09:52  kane_zch  阅读(362)  评论(0编辑  收藏  举报