Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)
I am trying to create a clone of the structure of our multi-terabyte file server. I know that cp --parents can move the file and its parent structure, but is there any way to copy my directory structure intact?

I want to copy to the Linux system and our file server is CIFS mounted there.

1 Answer

0 votes
by (36.8k points)

You can do something like:

find . -type d > dirs.txt

to create a list of directories, then

xargs mkdir -p < dirs.txt

to create the directories on a destination.

Want to be a Linux expert? Come and join this linux course

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...