Posts: 22,215
Threads: 2,842
Joined: May 2025
Reputation:
1
Hi everyone,
Is there any way in the Finder to copy a bunch of folders from one location to another, but WITHOUT copying their contents?
I could copy all the folders, then individually empty their contents, but maybe there's an easier way...
TiA
Posts: 22,215
Threads: 2,842
Joined: May 2025
Reputation:
1
Hmmmm... Doc, I'm trying that now... we'll see if it works... my Unix skillz are weak...
Edit: no, it looks like what that did was copy everything, including the folder contents...
Posts: 10,000
Threads: 626
Joined: Jul 2020
Reputation:
0
I just tried it and it worked.
I made 2 directories in a folder on my Desktop and filled one directory with 3 folders, each folder containing a file.
I then opened the Terminal and navigated to the first folder.
I typed this code at the prompt:
find . -type d | cpio -pvdm
Putting a space after the "-pvdm," I then dragged the folder-icon for the second directory onto the Terminal window and hit the Return key.
It copied the subdirectories without copying the files.
Posts: 22,215
Threads: 2,842
Joined: May 2025
Reputation:
1
Doc, hmmm, not sure what I'm doing wrong, but I did what you did with my files, and it still didn't work ... copied everything and not just the folders.
Posts: 21,452
Threads: 243
Joined: Sep 2016
Reputation:
0
I didn't really read Doc's instructions closely (sorry, lazy day), but it looks right. I was going to say make sure to check your switches, but Doc beat me to it.
Nathan
Posts: 10,000
Threads: 626
Joined: Jul 2020
Reputation:
0
Did you type it from scratch or did you copy and paste it?
Maybe you missed a character.
Posts: 22,215
Threads: 2,842
Joined: May 2025
Reputation:
1
copied/pasted.
Interestingly it does seem to copy all the folders first (I see them pop up in the folder in the Finder), THEN copy their contents when I do it.
Probably at this point just faster for me to trash their contents individually, then to figure it out...
Posts: 5,338
Threads: 670
Joined: Dec 2021
I searched in vain for such a command, Would that there was an equivalent to DOS:
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/Q] [/F] [/L] [/H] [/R] [/T]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...]
/T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.