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

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

问题描述

我想创建我们的多 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天全站免登陆