在 Linux 中,aliases(别名)通常保存在用户主目录下的 shell 配置文件里,具体取决于你使用的 shell。
~/.bashrc
~/.bash_aliases (如果有,通常被 .bashrc 引用)
/etc/bash.bashrc
/etc/profile
~/.zshrc
/etc/zsh/zshrc
~/.config/fish/config.fish
alias ll='ls -l'
funcsave ll
alias
alias ll='ls -l'
编辑对应配置文件,例如:
nano ~/.bashrc
添加:
alias ll='ls -l'
然后执行:
source ~/.bashrc
如果你告诉我你用的是 哪个 Linux 发行版 / 哪个 shell,我可以给你更精确的路径。