$ grep alias ~/.bashrc
# User specific aliases and functions
. ~/.alias
$ grep mydiff ~/.alias
alias mydiff='diff --ignore-space-change --ignore-blank-lines --side-by-side --suppress-common-lines'
$ alias mydiff
alias mydiff='diff --ignore-space-change --ignore-blank-lines --side-by-side --suppress-common-lines'
$ ssh -q localhost 'alias mydiff'
alias mydiff='diff --ignore-space-change --ignore-blank-lines --side-by-side --suppress-common-lines'
$ ssh -q localhost 'mydiff'
bash: mydiff: command not found
为什么不能通过 SSH 使用“mydiff”?谢谢
来自
man bash(1)
:将以下行添加到您的
.bashrc
文件中:或者: