ITeye博客

how to set alias and cancel alias in linux ?

chengyuanheng · 2014-09-16 10:50 · linux · 操作系统 · Markdown

SET:

 

1. run:  sudo vi ./.bashrc

2. set:  alias s_yes='yes'

            alias s_banner='banner'

            alias s_ddate='ddate'

            alias s_fortune='fortune'

            alias s_fortune_zh='fortune-zh'

            alias s_cal='cal 9 1752'

            alias s_xev='xev'

            alias s_xeyes='xeyes'

            alias s_cowsay='fortune | cowsay'

            alias s_cowthink='fottune | cowthink'

            alias s_factor='factor 999'

            alias s_g_moo='apt-get moo'

            alias s_b_moo='apt-build moo'

            alias s_sl='sl'

            alias s_logo='linuxlogo'

            alias s_oneko='oneko'

            alias s_who='who is i 

            alias lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

            alias short_log = shortlog --format='%H|%cn|%s' | grep '#2230'

 

3. run:  source ~/.bashrc

 

CANCEL:

 

1. run:  sudo vi ./.bashrc

2. set:  unalias s_yes

            unalias s_banner

            ...............

3.run:   source ~/.bashrc

评论(2)

  1. #2 楼 · chengyuanheng · 2014-09-26 16:55

    why I need create a new file named .bash_alias ? when I use VI , I can create a new file auto

  2. #1 楼 · zhangfortune · 2014-09-26 16:22

    why fortune in your fu*king alias ?

    note: no need use sudo when edit your .bashrc, as we know .bashrc in our home dir

    best do: create a new file named .bash_alias then source it in you .bashrc

评论功能维护中,当前仅展示历史评论。