I have created a file on a remote computer that I have ssh-ed into. I want to transfer the file back to the laptop I am using at the moment. I see that I am supposed to use the command:
scp username@server:/home/username/file_name /home/local-username/file-name
But I'm not still not sure of what I should use for my laptop (which is a macbook). For "home' I guess I use the path that appears when I type pwd into my terminal when it opens?
I try this and I get the message:
No such file or directory
I know this is easy stuff but I've not done it before. Any help would be great. Thank you.
The scp command copies files or directories between a local and a remote system or between two remote systems. You can use this command from a remote system (after logging in with the ssh command) or from the local system.
To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents. You'll be prompted for your password on the source system ( deathstar.com ). The command won't work unless you enter the correct password.
In the Terminal app on your Mac, use the scp command to copy a file or folder to or from a remote computer. scp uses the same underlying protocols as ssh . You're prompted for the user's password.
I would open another terminal on your laptop and do the scp from there, since you already know how to set that connection up.
scp username@remotecomputer:/path/to/file/you/want/to/copy where/to/put/file/on/laptop
The username@remotecomputer
is the same string you used with ssh initially.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With