CentOS7 ~/.bash_profile 예제

CentOS7 ~/.bash_profile 예제

■ 다음과 같이 /usr/local 디렉토리에 maven, tomcat, hadoop, hbase, jdk가 압축이 풀려 있다.
1

■ 각 디렉토리에 대해서 소프트 링크를 만든다.

[root@centos03 local]# ln -s apache-maven-3.3.3/ maven
[root@centos03 local]# ln -s apache-tomcat-7.0.61/ tomcat
[root@centos03 local]# ln -s hadoop-2.6.0/ hadoop
[root@centos03 local]# ln -s hbase-1.0.1/ hbase
[root@centos03 local]# ln -s jdk1.7.0_75/ java

■ ~/.bash_profile(사용자 계정 홈 디렉토리의 .bash_profile) 편집을 아래와 같이 작업한다.

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

alias tstart='/usr/local/tomcat/bin/catalina.sh start'
alias tstop='/usr/local/tomcat/bin/catalina.sh stop'
alias tstat='ps ax | grep tomcat'
alias tlog='tail -f /usr/local/tomcat/logs/catalina.out &'

export JAVA_HOME=/usr/local/java
export MVN_HOME=/usr/local/maven
export TOMCAT_HOME=/usr/local/tomcat
export HBASE_HOME=/usr/local/hbase
export HADOOP_HOME=/usr/local/hadoop

PATH=$MVN_HOME/bin:$TOMCAT_HOME/bin:$JAVA_HOME/bin:$HBASE_HOME/bin:$HADOOP_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin

export PATH

■ ~/.bash_profile을 현재 환경에 반영한다.

# source ~/.bash_profile

   

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다