ILD

ubuntu添加alias
作者:Herbert Yuan 邮箱:yuanjp@hust.edu.cn
发布时间:2018-1-18 站点:Inside Linux Development

添加一个alias,在shell启动时就生效。可以添加到~/.bashrc。


也可以添加到~/.bash_aliases,因为.bashrc会source这个文件。

1
2
3
4
5
6
7
8
9
10
11
cat ~/.bashrc 
...
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
 
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
...


添加一个greps别名,grep时排除编译产物和cscope数据库。

1
2
cat ~/.bash_aliases 
alias greps='grep --exclude="*.o" --exclude="*.ko" --color=always --exclude="cscope*"'


Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.