How to transfer files between computers on a network

kitepilot at kitepilot.com kitepilot at kitepilot.com
Wed Oct 22 16:10:48 MST 2008


The reason why you HAVE to use /sbin/ip is because /sbin is not on your 
path.  Multiple reasons for that, but mostly because technically /sbin "is 
for root" (that's a VERY condensed explanation) 


As a rule of thumb (valid always if you only have one adapter) "your 
interface" is eth0 (or eth[whatever] if you HAD to change the adapter, or 
wlan0/ath0/wifi0 for wireless) 

So 

> 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>     link/ether 00:11:2f:06:65:08 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.64/24 brd 192.168.1.255 scope global eth0
192.168.1.64 is your IP address. 

Also, as a rule of thumb (not always true but irrelevant to you), if the 
machines are connected to the same router, only the last number changes 

so
Machine 1 is 192.168.1.64
Machine 2 is 192.168.1.66
Note that only the last number changes. 

This is valid ONLY with a netmask of 255.255.255.0 (or 192.168.1.64/24) 
which happens to be the case for just about every router you pull out of a 
shelf in Bestbuy/Circuit City/Walmart.
Don't worry about it, just assume it is "true" 

 

Finally:
>  scp /filenameA.txt/to/copy joe at 12.34.56:/copy/filenameB.txt/to

Should rather be:
scp /to/copy/filenameA.txt joe at 12.34.56:/copy/to/filenameB.txt 

Which: 

Will copy a file name "filenameA.txt", located in path "/to/copy" in THIS 
machine, to user "joe" AT machine 12.34.56, in path "/copy/to" with name 
"filenameB.txt"
If you omit the name it will be copie with same name. 

Hope that helps...
Enrique 

 

Josef Lowder writes: 

> On 10/22/08, enrique <kitepilot at kitepilot.com> wrote:
>> Linux: Open up a terminal and type:
>>  ip addr show
>>  and choose the adapter that connects to the network you want.
> 
>>  use scp as:
>>  scp /file/to/copy user at machine:/copy/file/to
> 
>>  It's easy, even I can do it.
>  
> 
> Thanks Enrique ... but the problem is ... you are brilliant
> and I guess I just don't have all the wires connected. 
> 
> I did find that I have to use /sbin/ip addr show
> since 'ip' was not found. 
> 
> But below are the results I got from my two linux boxes,
> and I can't figure out which of all these different number
> sets is the 'ip' number for each machine. 
> 
> == from machine "A"
> $ /sbin/ip addr show
> 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 scope host lo
> 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>     link/ether 00:11:2f:06:65:08 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.64/24 brd 192.168.1.255 scope global eth0 
> 
> == from machine "B"
> $ /sbin/ip addr show
> 1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 scope host lo
> 2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
>     link/ether 00:14:85:1e:5f:5e brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.66/24 brd 192.168.1.255 scope global eth0 
> 
> Furthermore, from your excellent example (thank you very much),
> scp /file/to/copy user at machine:/copy/file/to 
> 
> I still do not understand how to put which numbers where,
> and how the actual syntax should look.  Is it like this: 
> 
>  scp /filenameA.txt/to/copy joe at 12.34.56:/copy/filenameB.txt/to 
> 
> How would scp know in what directory or folder to put the file
> to be copied?
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


More information about the PLUG-discuss mailing list