Operating System - HP-UX
1752806 Members
5977 Online
108789 Solutions
New Discussion юеВ

rcp or cp on same machine, any difference

 
makp
New Member

rcp or cp on same machine, any difference


Hi,

Is there any difference if I use rcp instead of cp on same machine for copying large files?

Apreicate if someone can throw some lights.

Thanks
7 REPLIES 7
Rajeev  Shukla
Honored Contributor

Re: rcp or cp on same machine, any difference

cp is more prefered on the same system (localhost) coz rcp goes through al the authentication checks and would happen over the NIC where as cp is internal.
In short rcp will take a bit longer compared to cp in localhost
Gokul Chandola
Trusted Contributor

Re: rcp or cp on same machine, any difference

Hi,

There are many differences within these two methods, hint is following.

*)The NFS CP will bring the source file into the buffer cache, _and_ will have the destination file in the buffer cache. The rcp will only bring the source file into the buffer cache.

*) rcp is over TCP

Regards,
Gokul Chandola
There is always some scope for improvment.
SKR_1
Trusted Contributor

Re: rcp or cp on same machine, any difference

rcp is used for remote copy from another server to server in which you are logged in or vice versa.

Thanks

SKR
Sajjad Sahir
Honored Contributor

Re: rcp or cp on same machine, any difference


rcp means remote copy
cp means copying

rcp is mainly using to copy from system to anohter

while cp is using internal in system


thanks and regards

Sajjad Sahir
Steven E. Protter
Exalted Contributor

Re: rcp or cp on same machine, any difference

Shalom,

rcp between machines

cp within one system.

cp is a bit more reliable.

rcp won't copy properly to the same system. Why would you use it to run a local copy through the system NIC card?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: rcp or cp on same machine, any difference

Why not start by looking at the man page:

rcp(1) rcp(1)

NAME
rcp - remote file copyDESCRIPTION
The rcp command copies files, directory subtrees, or a combination of files and directory subtrees from one or more systems to another.


After reading that, I wouldn't even think to use it within one system. I mean, "why"????


Pete

Pete
Laurent Menase
Honored Contributor

Re: rcp or cp on same machine, any difference

If you mean
between
rcp
cp from or to NFS

Then rcp is usually better as it sends directly the file from buffercache to the socket.

cp will cause a copy from buffercache to user space, hen from userspace to buffercache, then from buffercache over NFS to the remote system, then to disk