html/wordpress/wp-content/themes/hogestyle/hchuno.php
というファイルがあったとする。
カレントディレクトリにhogeというディレクトリを作り、そこに上記のディレクトリ構造を保ったまま、hchuno.phpというファイルをコピーしたい場合、cpコマンドに--parentsというオプションを付ける。
$ cp --parents html/wordpress/wp-content/themes/hogestyle/hchuno.php hoge
実行結果は以下のとおり。
hoge
│
└───html/wordpress/wp-content/themes/hogestyle/hchuno.php