Friday, September 3, 2010

Unix command to copy files between 2 Systems

Dear Reader,
Today I am writing Unix commands to copy files and directories in Unix systems without FileZilla or 
WinScp like User Interfaces.

Suppose you want to copy a file from one system (SOURCE) to another system (DESTINATION), Login into 
DESTINATION system. Go to the location where you want to keep the copied contents.

Assumptions:
    SOURCE IP: X.X.X.113  (Type full numeric complete IP address in copy command).
    DESTINATION IP: X.X.X.50 (Type full numeric complete IP address in copy command).
    UserName for SOURCE IP: dm0945
    Password: System will ask once you enter the below copy command.    
    First login into DESTINATION IP system and move to destination directory, then type below command:
    
    scp dm0945@X.X.X.113:/home/dmodi/log/q2-2011-09-21.log  .    (Press Enter, it will ask password for X.X.X.113 system.
    The log file will be copied to current location of DESTINATION IP System. 
    
Above command will copy a file, if you want entire diectory to copy, tweak the above command as below:
    scp -r dm0945@X.X.X.113:/home/dmodi/log/q2-2011-09-21.log  . (Press Enter, it will ask password for X.X.X.113 system.
    Entire log directory will be copied to current location of DESTINATION IP System. 


---------------END---------------

No comments:

Post a Comment