首页 > 解决方案 > 如何在 .bashrc 中为 ssh 命令创建别名?

问题描述

我正在尝试在我的用户的 .bashrc 文件中为 ssh 命令创建一个别名。这是我的 .bashrc 的样子:

alias ll = 'ls -al'
alias tron = 'ssh sshtron.zachlatta.com'

结果并没有奏效。这是我打开 Git Bash 时始终记录的内容:

bash: alias: =: not found
bash: alias: ls -al: not found
bash: alias: tron: not found
bash: alias: =: not found
bash: alias: ssh sshtron.zachlatta.com: not found

标签: bashalias

解决方案


摆脱空间。 alias tron='ssh sshtron.zachlatta.com'


推荐阅读