문서의 이전 판입니다!
# date 관련 D_YMD=`date +%Y%m%d` D_Y-M-D=`date +%Y-%m-%d` # TMOUT=0 export TMOUT D_YMD D_Y-M-D
export를 사용하면 하위 프로세스까지 환경변수가 상속됨
date와 같이 실행된 결과를 Value로 받을 때는 ` ← 탭위의 기호 임에 주의하자!!
~/.bashrc 파일에 내용 추가
# 검색엔진 관련 2020-02-10, Repia alias rlog='tail -n200 -f ${RSA_ROOT}/logs/javaLog/log_${D_YMD}.txt' alias tlog='tail -n200 -f ${TOMCAT_ROOT}/logs/localhost.${D_Y-M-D}.log' alias search='cd ${RSA_ROOT}/bin' alias sfront='cd ${RSA_ROOT}/bin/html'
#으로 시작하면 주석으로 인식
적용 방법 파일을 수정한 후 적용하기 위해서는 로그아웃을 하고 다시 로그인을 해야 하지만, 아래와 같이 실행하면 현재의 Shell에서도 적용된다.
$> source ~/.bashrc or $> . ~/.bashrc
alias 명령어
[www@dev tmp]$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias vi='vim' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' [www@dev heqms.repia.com]$
이전에 설정된 내용 확인 가능
# .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