Thursday, 19 July 2012

Using scp command copy a file or dir


If you need to copy a file or a directory you can use the scp command from the machine where the

data is available. you can check out below examples....


#     scp  file1 192.168.1.10:/root/

                      (  This will copy  file1 ( source )  to remote host = 192.168.1.10  ( Destination )  in

specified location  i.e. the root path ).




#    scp  -r  xdir  192.168.1.10: /
              
  (  The ‘  -r   is used  to copy the dir. i.e.  Recursion ).


  

#   scp  -p  file1  192.168.1.10: /

       (  The ‘ –p ‘  is used for preserving original  times  and  permissions but please note that it can

not preserve original ownership and groupmembership ).

No comments:

Post a Comment