把下面的代码加入~/.bashrc中 getscp () { echo $USER@$(hostname -i):$(readlink -f $1) } source ~/.bashrc 然后就可以在命令行中直接使用getscp your.file了