Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-07-2012, 05:09 PM
|
#1
|
|
LQ Newbie
Registered: May 2012
Posts: 14
Rep: 
|
Copying files from host onto my computer using ssh
Hi,
I have ssh'ed into a remote computer. I want to transfer a file from that computer onto my computer. I know how to do exactly the opposite (using scp)
What would be the syntax for doing this?
Any help would be greatly appreciated
Thanks!
Best,
Adwait
|
|
|
|
06-07-2012, 05:19 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
the opposite as in copy from your computer to the remote one? Just change the options around on the scp command line like you would do for any other file copy command:
scp file.txt user@server:file.txt
|
|
|
|
06-07-2012, 05:26 PM
|
#3
|
|
LQ Newbie
Registered: May 2012
Posts: 14
Original Poster
Rep: 
|
Hi Chris,
Thanks for the reply!
So in this case,
file.txt is the file on the server that I want to copy?
There are two file.txt what should each one of them be?
Thanks!
Quote:
Originally Posted by acid_kewpie
the opposite as in copy from your computer to the remote one? Just change the options around on the scp command line like you would do for any other file copy command:
scp file.txt user@server:file.txt
|
|
|
|
|
06-07-2012, 10:45 PM
|
#4
|
|
LQ Newbie
Registered: Jun 2012
Posts: 7
Rep: 
|
Quote:
Originally Posted by Adwat
Hi,
I have ssh'ed into a remote computer. I want to transfer a file from that computer onto my computer. I know how to do exactly the opposite (using scp)
What would be the syntax for doing this?
Any help would be greatly appreciated
Thanks!
Best,
Adwait
|
If you know the exact location of the file, maybe its easier using rsync instead. You dont have to logged into remote server.
Code:
rsync -avH -e ssh --progress localfilename user@remoteserver:/fullpath_on_remote
eg : rsync -avH -e ssh --progress /home/user/*.txt root@192.168.1.1:/var/www/html
: upload local file to server
or
rsync -avH -e ssh --progress user@remoteserver:/fullpath_on_remote localpath
eg : rsync -avH -e ssh --progress admin@192.168.1.1:/var/www/html/*.html /home/geek/
: download *.html files from server to local path /home/geek/
|
|
|
|
06-08-2012, 01:48 AM
|
#5
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
why would you use rsync just for that? Quite some overkill no?
|
|
|
|
06-08-2012, 02:41 AM
|
#6
|
|
LQ Newbie
Registered: Jun 2012
Posts: 7
Rep: 
|
Quote:
Originally Posted by acid_kewpie
why would you use rsync just for that? Quite some overkill no?
|
I never used scp before. But I'd just give it a try and it looks like rsync too.
Frankly speak I have no idea about the differences between them, or maybe its security issue ?
|
|
|
|
06-08-2012, 02:43 AM
|
#7
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,711
|
no, it's not like rsync. it's like cp, but with a bit of remote connectivity thrown in too.
|
|
|
1 members found this post helpful.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:08 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|