LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to transfer data between two computers (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-transfer-data-between-two-computers-559981/)

littlewenwen 06-07-2007 01:24 PM

how to transfer data between two computers
 
Dear All,

I have two computers:

Computer A is a laptop with Suse Linux 10.0, it has wiresless internet connection

Computer B is a desktop computer with RedHat5 Enterprise, it has wired internet connection.


I want to transfer some data (~2GB) from computer A to computer B, will that be easy or possible to do? Do I have to make one of these two computers a server? In that case, do I have to have a static IP address for the server?


I in fact have tried to use an external hard drive (not linux formatted) to transfer the data between the two computers. However, after the transfer, some file name changed (like "A" becomes "a", and "B" becomes "b" ). So I am thinking if I can directly transfer the data between the two computers, as they are both linux system, such error might be avoided.

Can any one help?

Centinul 06-07-2007 01:31 PM

There really are a large number of ways to transfer data between two systems. I think first you will have to explain or describe the network that exists between the two PCs so we can get a better understanding, and tailor the recommendation.

Some tools that come to mind to transfer files are:
cp (or scp)
rsync
ftp

HTH,

Centinul

forrestt 06-07-2007 01:36 PM

The following example assumes the laptop IP is 111.222.333.444, and is run on your desktop:
Code:

/usr/bin/rsync -trlpoge ssh 111.222.333.444:/path/to/data /path/to
Note: do not include the trailing / in either of the above paths. This will create the data directory under /path/to on your local system, and move all the files there.

You need to make sure you can ssh to the laptop from the destop before running the command, and you need to run the command as root.

This will take a LONG time to finish.

littlewenwen 06-07-2007 01:38 PM

i don't think there is direct connection between my two computers ( these two computers are bought at different times, and i just installed linux on them). Each computer have access to the internet, just like a normal PC.

littlewenwen 06-07-2007 01:41 PM

I don't have static IP address for either of my two computers

forrestt 06-07-2007 01:42 PM

You don't need to, you just need to know the IP. This can be found by running "ifconfig -a".

littlewenwen 06-07-2007 01:46 PM

Thank you!

If I want to use, for example SSH, do I have to make one of the computer a server with a static IP address?

slackhack 06-07-2007 01:46 PM

you don't really need a static IP, as long as you know it (running #ifconfig on each computer will tell you).

edit: i see forrestt already covered that, so:

how are the computers connected to the internet? do you have a router they both go through? or are they separate connections altogether (e.g., one on cable, one on dial up, etc.)?

for ssh/scp, at least one computer has to run the ssh daemon (sshd -- included in openssh). then you can log into it from the other one.

quick howto:
http://www.linuxhomenetworking.com/w...d_File_Copying

masonm 06-07-2007 02:01 PM

You can also ssh into the laptop and then use the scp command to copy the needed files.

littlewenwen 06-07-2007 02:06 PM

strange. I found IP for my laptop. However, the command "ifconfig -a" doesn't work for redhat. I do both as a root.

Anyway, the two computers are both using the net service provided by my school. So I can SSH my laptop from my Desktop, right? Do I have to use my Desktop as root?

forrestt 06-07-2007 02:07 PM

Sorry I think I misread something in your first post when i made the suggestion above. That is if you need to do repeatedly update the files on the desktop with changes you have made on the laptop.

If you just need to copy once:

Code:

scp -r 111.222.333.444:/path/to/data /local/path

littlewenwen 06-07-2007 02:22 PM

thank you.

it really took a long time just for connecting. i am sorry to ask, but is there some other ways?

forrestt 06-07-2007 02:34 PM

You could also tar the data to your external hard drive, and then untar it to the desktop. Attach the drive to the laptop and then:

Code:

cd /path/to/data
tar -cvf /path/to/externaldrive/laptop.tar .

Then attach the drive to the desktop and then:
Code:

cd /path/to/where/you/want/data
tar -xvf /path/to/externaldrive/laptop.tar


custangro 06-07-2007 02:52 PM

Like forrest said. You can use scp and tar to transfer files:

Code:

cd /path/to/files
tar -cvf files.tar .
scp files.tar user@ipaddressofB:/path/to/destination

note the ":" Also remeber to keep the "user@ipaddressofB:/path/to/destination" together with no spaces.
Also; note the "." in the tar command. The "." means "this directory."
-custangro

masonm 06-07-2007 02:59 PM

Honestly the easiest way is to get a usb flash drive. But ssh should work for you.


All times are GMT -5. The time now is 08:24 AM.