Copy folder structure without contents

Starting the new year so time to regenerate a number of folders for the new year. Every year I look and can't find a simple way to do what should be a simple thing. Any tips?

It's for simple things like:

2023 >Gas Bills; Electric Bills; Visa card; Amex Card etc.

recreated as:

2024 >Gas Bills; Electric Bills; Visa card; Amex Card etc.


I really don't want to go into Terminal and I tried figuring out Automator, but feel like I need an hour long class to save myself a 15 minute task.


Thanks!


MacBook Pro 15″, macOS 10.12

Posted on Dec 28, 2023 11:30 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 28, 2023 3:11 PM

Make a folder template that has nothing in it. Copy that template each year and use the copy.

10 replies

Dec 29, 2023 2:59 PM in response to nickjb

Do you have room to duplicate the 2023 folder holding all of the files? If you do this will work:


1 - after duplicating the 2023 folder rename it 2024.

2 - open 2024 folder and click on the search button in the toolbar

3 - search for a period (.). All files have a period before the extension.

4 - do a Select All (⌘+A). This will select all files in the 2024 subfolders.

5- use the key combination of ⌘+Delete to move all of the selected files to the Trash.

6 - use the key combination of Shift+Command+Delete to empty the Trash.



It works quite easily and well.


Dec 28, 2023 11:42 AM in response to nickjb

Applications -> Utilities -> Terminal


cd "to the folder with the directory tree you want to clone"

find . -type d | while read dir; do mkdir -p "/new/path/$dir"; done


Before doing this for real, you may want to change the mkdir to echo, and look at the output to see if the new path information is correct. Then, put the mkdir back and go for it.

Mar 25, 2024 11:01 AM in response to nickjb

Actually, with APFS as the current file system on macOS, if you duplicate a file, it doesn’t actually take up any extra space in storage until it’s modified. If you had a 1TB file or directory and duplicate it, it will be duplicated instantly and your available storage space will not change. APFS will only save a new copy once there are differences in the files.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Copy folder structure without contents

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.