Preloader image
DDD

리눅스

리눅스 단축키 alias 작성법

작성자 관리자 (admin)
조회수 840
입력일 2021-11-04 09:58:26

단축키를 만드는 방법 - alias
간단한 명렬어 또는 여러명령어를 1개이상의 단어로 "단축키" 형태를 만드는 것.
.bashrc , .bash_profile 에 등록

# cd
# cat .bashrc

# .bashrc - l 을 타이핑하면 ls -al 명령어가 수행됩니다.
alias l='ls -al'

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# User specific aliases and functions

------------------------------------------------------

$ cat .bashrc
# .bashrc
alias l='ls -al'

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# User specific aliases and functions
[khan666@umj64-007 ~]$ 
[khan666@umj64-007 ~]$ .bash_profile
bash2: .bash_profile: command not found
[khan666@umj64-007 ~]$ cat .bash_profile
# .bash_profile
alias l='ls -al'

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

LANG=ko_KR.UTF-8
export LANG
# User specific environment and startup programs
if [ -f /etc/userbashenv/khan666 ];then
        . /etc/userbashenv/khan666
fi

JAVA_HOME=/usr/local/jdk8
export JAVA_HOME
PATH=/home/bin:/bin:$JAVA_HOME/bin:/usr/bin
export PATH
CATALINA_HOME=/home/hosting_users/khan666/tomcat
export CATALINA_HOME
CATALINA_BASE=/home/hosting_users/khan666/tomcat
export CATALINA_BASE

unset USERNAME
 

적용 시키기
$ source .bashrc
 

^