Using scp in terminal

I created a file on a remote computer into which I entered ssh-ed. I want to transfer the file back to the laptop that I am currently using. I see that I should use the command:

scp username@server :/home/username/file_name /home/local-username/file-name 

But I'm still not sure what I should use for my laptop (which is a macbook). For home, I assume that I use the path that appears when I type pwd into my terminal when it opens?

I try this and I get a message:

 No such file or directory 

I know this is easy, but I have not done this before. Any help would be great. Thanks.

+7
source share
2 answers

I would open another terminal on your laptop and make scp from there, since you already know how to establish this connection.

 scp username@remotecomputer :/path/to/file/you/want/to/copy where/to/put/file/on/laptop 

username@remotecomputer are the same lines that you used with ssh initially.

+18
source

You can download in the current directory . :

 cd # by default, goes to $HOME scp me@host :/path/to/file . 

or you have HOME directly:

 scp me@host :/path/to/file ~ 
+2
source

All Articles