Why cp a directory into itself still create an empty directory?
From:
Peng Yu
Subject:
Why cp a directory into itself still create an empty directory?
Date:
Sun, 14 Jun 2015 11:08:34 -0500
Hi,
The following code shows that cp a directory into itself still create
the tmp directory in the destination. Is better not to create it?
/tmp$ mkdir tmp
/tmp$ $(type -P cp) -r tmp tmp
/usr/local/opt/coreutils/libexec/gnubin/cp: cannot copy a directory,
‘tmp’, into itself, ‘tmp/tmp’
/tmp$ ls -lgd /tmp/tmp
drwxr-xr-x 3 wheel 102 Jun 14 11:05 /tmp/tmp
--
Regards,
Peng
[Prev in Thread]
Current Thread
[Next in Thread]
Why cp a directory into itself still create an empty directory?,
Peng Yu<=