1

/home/private_html/userx/に完全なディレクトリコンテンツをコピーしたいのです/home/private_html/usery/が、問題はディレクトリuserxにいくつかのシンボリックリンクが含まれているcpことです。それを使用する場合はスキップします(スキップが発生します。シンボリックリンクfileがディレクトリを指している場合は、スキップが発生します。代わりにWHOLEディレクトリをコピーしてください...)。

私が使用していたコマンドは次のようになります。

# cp -iprv /home/private_html/userx/ /home/private_html/usery/

ディレクトリを「そのまま」他の場所にコピーする解決策はありますか?

4

2 に答える 2

0

FreeBSD では、オプションcpはありません。-rそれは-Rあなたが望むことをするはずです:

 -R    If source_file designates a directory, cp copies the directory and
       the entire subtree connected at that point.  If the source_file
       ends in a /, the contents of the directory are copied rather than
       the directory itself.  This option also causes symbolic links to be
       copied, rather than indirected through, and for cp to create spe‐
       cial files rather than copying them as normal files.  Created
       directories have the same mode as the corresponding source direc‐
       tory, unmodified by the process' umask.
于 2013-03-20T00:37:54.563 に答える