在 Linux 中,使用 alias 命令可以创建命令的别名,以便更快地执行常用命令或组合
ll 的别名,它将代替 ls -l 命令:alias ll='ls -l'
ll
如果一切正常,您应该看到与执行 ls -l 相同的输出。
unalias 命令:unalias ll
~/.bashrc(针对 Bash shell)或 ~/.zshrc(针对 Zsh shell)文件中。例如,要将 ll 别名添加到 ~/.bashrc 文件中,请执行以下操作:echo "alias ll='ls -l'" >> ~/.bashrc
source ~/.bashrc
现在,即使在新的终端会话中,ll 别名也应该仍然有效。