2011年4月23日 星期六

Linux 複製子目錄結構,不複製檔案 Copy all subdirectory structures without files

Copy all subdirectory structures without files .......
命令列:

find -maxdepth 5 -type d -exec mkdir /destination/path/you/want\{\} \;

  1. 複製目前目錄之下的所有子目錄結構,但是不包含目錄中的檔案。
  2. 將目錄結構複製到 /destination/path/you/want 之下
  3. -maxdepth 選項設定複製子目錄的最大深度
  4. -type d 設定只搜尋目錄名稱
打完收工

沒有留言: