linux command

rcp

Linux Command – rcp ใช้ในการคัดลอก file ข้ามเครื่อง server

 

คำสั่ง

rcp <local file> <remote host>:<remote file>

$ rcp localfile host2:/home/eng/staff

 

rcp <remote host1>:<remote file1> <remote host2>:<remote file2>

$ rcp host1:/home/eng/staff/newplan host2:/home/eng/staff

 

โครงสร้างคำสั่ง

 rcp [ -p] [ -F] [ -k realm ] [-m] { { User@Host:File | Host:File | File } { User@Host:File | Host:File | File | User@Host:Directory | Host:Directory | Directory } | [ -r] { User@Host:Directory | Host:Directory |Directory } { User@Host:Directory | Host:Directory | Directory } }

 

รายละเอียด

เป็นคำสั่งที่ใช้ในการคัดลอก file ข้ามเครื่อง server หรือ ftp  ปัจจุบันนิยมใช้ scp แทน เพราะเป็น ssl secure มากกว่า

 

Option

-p Preserves the modification times and modes of the source files in the copies sent to the destination 
only if the user has root authority or is the owner of the destination. Without this flag, the umask command 
at the destination modifies the mode of the destination file, and the modification time of the destination 
file is set to the time the file is received.
When this flag is not used, the umask being honored is the value stored in the appropriate database. It is not 
the value that is set by issuing the umask command. The permission and ownership values that result from 
the umask command do not affect those stored in the database.
-r Recursively copies, for directories only, each file and subdirectory in the source directory into 
the destination directory.
-F Causes the credentials to be forwarded. In addition, the credentials on the remote system will be marked forwardable 
(allowing them to be passed to another remote system). This flag will be ignored if Kerberos 5 is not the current 
authentication method. Authentication will fail if the current DCE credentials are not marked forwardable.
-k realm Allows the user to specify the realm of the remote station if it is different from the local systems realm. 
For these purposes, a realm is synonymous with a DCE cell. This flag will be ignored if Kerberos 5 is not 
the current authentication method.
-m Support for metacharacters in filenames.

 

กลุ่มคำสั่ง

scp

 

Reference:

คำสั่ง Unix – Linux Command

Linux, Unix

 

Author: Suphakit Annoppornchai

Credit: https://saixiii.com

One Thought to “rcp – Linux Command คำสั่งคัดลอก file ข้ามเครื่อง server”

Leave a Reply