将文件夹结构(无文件)从一个位置复制到另一个位置 [英] Copy folder structure (without files) from one location to another

查看:170
本文介绍了将文件夹结构(无文件)从一个位置复制到另一个位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我们的多TB文件服务器的结构创建一个克隆.我知道cp --parents可以移动文件及其父结构,但是有什么办法可以完整地复制目录结构?

I want to create a clone of the structure of our multi-terabyte file server. I know that cp --parents can move a file and it's parent structure, but is there any way to copy the directory structure intact?

我想复制到linux系统,并且我们的文件服务器安装在CIFS上.

I want to copy to a linux system and our file server is CIFS mounted there.

推荐答案

您可以执行以下操作:

find . -type d > dirs.txt

创建目录列表,然后

xargs mkdir -p < dirs.txt

在目标上创建目录.

这篇关于将文件夹结构(无文件)从一个位置复制到另一个位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆