在 Linux 里,“禁用 alias”通常有几种场景,下面按常见情况给你说明:
使用 \ 或 command 绕过 alias:
\ls
command ls
这样可以忽略 ls 的 alias,直接执行原命令。
用 unalias:
unalias ll
只影响当前 shell 会话。
alias 一般定义在以下文件中:
~/.bashrc~/.bash_aliases~/.zshrc(zsh)/etc/bashrc 或 /etc/profile(系统级)方法:
# alias ll='ls -l'
source ~/.bashrc
如果你不想加载任何 alias,可以:
bash --norc
#!/bin/bash --norc
alias
如果你能说明是 bash / zsh、临时还是永久、单个还是全部 alias,我可以给你更精确的命令。