Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using scp in terminal

Tags:

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.

like image 601
user1551817 Avatar asked Jan 14 '13 20:01

user1551817


People also ask

What does SCP do in terminal?

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.

How do I SCP a folder in Terminal?

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.

Does SCP work in Mac?

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.


1 Answers

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.

like image 142
Matt DiMeo Avatar answered Oct 28 '22 14:10

Matt DiMeo