---
title: "how to set alias and cancel alias in linux ?"
author: "chengyuanheng"
date: "2014-09-16T10:50:28Z"
tags: []
categories: ["操作系统"]
slug: "how-to-set-alias-and-cancel-alias-in-linux"
draft: false
lastmod: "2015-01-08T15:37:15Z"
id: 2116896
url: "https://cckkll.iteye.com/blog/2116896"
---

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