简体   繁体   English

尝试将文件从本地 Mac 上传到远程 Ubuntu 服务器

[英]Trying to upload a file from local Mac to remote Ubuntu server

scp -r /Users/Brain/Desktop/tree.png account@address:/home/directory

I successfully connect to server and enter password, but receive this message "/Users/Brain/Desktop/tree.png: No such file or directory found"我成功连接到服务器并输入密码,但收到此消息“/Users/Brain/Desktop/tree.png: No such file or directory found”

I know the file exists, it is sitting on my desktop and I can open it.我知道该文件存在,它位于我的桌面上,我可以打开它。

Any guidance would be much appreciated!!任何指导将不胜感激!

Tried looking at this post but it did not help: scp files from local to remote machine error: no such file or directory尝试查看这篇文章,但没有帮助: scp files from local to remote machine error: no such file or directory

Typo?错字? For a location like /Users , better odds are suggested for a person with the name Brian over one like Brain.对于像/Users这样的位置,建议名字为 Brian 的人比 Brain 这样的人更有可能。 After reversing the vowels, what happens with this command?反转元音后,这个命令会发生什么?

ls -l /Users/Brian/Desktop/tree.png

When presented with unexpected errors for file(s) known to exist, there's usually an issue with one pathname component.当出现已知存在的文件的意外错误时,通常存在一个路径名组件的问题。 Start with the full path and drop trailing components until there's no error, eg:从完整路径开始并删除尾随组件,直到没有错误,例如:

ls /Users/Brain/Desktop/tree.png
ls /Users/Brain/Desktop
ls /Users/Brain
ls /Users

Some shells can trim a pathname component from the previous command with:h;一些 shell 可以使用:h; 修剪上一个命令中的路径名组件。 try repeating this:尝试重复这个:

!!:h

After typing the above, another possible shortcut is UP-arrow RETURN输入上述内容后,另一个可能的快捷方式是向上箭头 RETURN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM