我用 ssh 登录到我们实验室的一台电脑上。我想从那里复制一个 .txt 到我家里的笔记本电脑。所以我做了:
root@hostname:/home/gsamaras/konstantis/cholesky# scp gsamaras@hostname.gr:konstantis/cholesky/o_755.txt /
o_755.txt 100% 23KB 22.6KB/s 00:00
root@hostname:/home/gsamaras/konstantis/cholesky# scp gsamaras@hostname.gr:konstantis/cholesky/o_755.txt /home/gsamaras
o_755.txt 100% 23KB 22.6KB/s 00:00
Run Code Online (Sandbox Code Playgroud)
通过两次尝试,我都找不到该文件。它去了哪里?而且,现在我认为其中应该存在两个,我不想留下任何剩菜。
这是我检查的内容:
gsamaras@gsamaras:~$ pwd
/home/gsamaras
gsamaras@gsamaras:~$ ls
Desktop Music Templates
Documents Pictures ubuntu_May_2015.zip
Downloads Public Videos
examples.desktop skype-ubuntu-precise_4.3.0.37-1_i386.deb
gsamaras@gsamaras:~$ ls /
bin dev initrd.img lib64 mnt root srv usr vmlinuz.old
boot etc initrd.img.old lost+found opt run sys var
cdrom home lib media proc sbin tmp vmlinuz
gsamaras@gsamaras:~$
Run Code Online (Sandbox Code Playgroud)
小智 5
请注意您尝试使用此scp命令实现的目标:
root@hostname:/home/gsamaras/konstantis/cholesky#
Run Code Online (Sandbox Code Playgroud)
您root在名为的机器上hostname
scp gsamaras@hostname:konstantis/cholesky/o_755.txt /
Run Code Online (Sandbox Code Playgroud)
o_755.txt
您正在尝试在当前机器上scp从hostname:konstantis/choleskyasgsamaras到文件。/o_755.txt
然后您登录到一台名为的机器gsamaras并在那里查找文件。它不会在gsamaras。尝试寻找文件/和/home/gsamaras/ 上hostname(当前计算机)。
为了做我认为你想做的事情,你必须运行以下scp命令:
scp gsamaras@hostname:konstantis/cholesky/o_755.txt gsamaras@gsamaras:~/
Run Code Online (Sandbox Code Playgroud)
hostname当前的机器在哪里。