在 Ubuntu(以及大多数 Linux 发行版)中,aliases(别名) 一般保存在用户级或系统级的 shell 配置文件中,具体取决于你使用的是哪种 shell(通常是 bash 或 zsh)。
通常保存在:
~/.bashrc
或者(部分系统):
~/.bash_aliases
很多 Ubuntu 系统会在
~/.bashrc中写一段:if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi所以 aliases 也可能单独放在
~/.bash_aliases
/etc/bash.bashrc
或:
/etc/profile
~/.zshrc
/etc/zsh/zshrc
echo $SHELL
或:
ps -p $$
alias
只看某一个:
alias ll
nano ~/.bashrc
添加:
alias ll='ls -alF'
保存后执行:
source ~/.bashrc
如果你愿意,可以告诉我:
我可以给你更精确的路径和示例。