Today i learnt how to send files in a networt using 'scp' command.
scp(secure copy) is used to copy files across an ssh connection that will be encrypted by algorithms. so its more secure.
To use this command you need to have open-ssh installed in the hosts.
so lets see how to use it,
scp [[user1@]from-host:]source-file [[user2@]to-host:][destination-file]user1 = the user1 is the one who owns the file i.e to be transferred.
user2 = user 2 is the one whom you are trying to send the file.
from-host = is the user1 ip address.
to-host = is the user2 ip address.
source-file = is where the file is the user1's computer.
destination-file = where you want to store the file in user2's computer after copying.
there are few options
- -p preserves the modification and access time,and also the permission of the source-file in destination-file
- -q wont show the progress indicator
- -r recursive,i.e it copies all the contents in the source-file (directory)
- -v shows debug messages
scp -r parthi@198.122.2.1:/home/parthi/books student@198.122.2.5:/home/student/
this copies the entire directory...
try it,
have fun. :)
No comments:
Post a Comment