在 Ubuntu 里,“aliases”通常指的是 shell alias(命令别名),最常见于 bash 或 zsh。下面按不同场景说明如何“禁用”。
alias
unalias ll
关闭终端后失效
\ll
# 或
command ll
常见文件:
~/.bashrc~/.bash_aliases~/.zshrc(zsh)编辑文件:
nano ~/.bashrc
找到类似:
alias ll='ls -alF'
删除或注释:
# alias ll='ls -alF'
保存后生效:
source ~/.bashrc
~/.bashrc 中关闭 alias 加载有些系统在 .bashrc 里有:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
你可以:
mv ~/.bash_aliases ~/.bash_aliases.bak
系统级 alias 可能在:
/etc/bash.bashrc
/etc/profile
⚠️ 修改前建议备份:
sudo cp /etc/bash.bashrc /etc/bash.bashrc.bak
在 ~/.bashrc 末尾加:
unalias -a
⚠️ 会清除所有 alias
有时不是 alias,而是:
检查:
type ll
如果你能告诉我:
我可以给你更精确的命令。