The story behind this post is that I recently copied my development directory to an USB disk because i wanted to clean up my old Macbook Pro’s harddisk for space. After I checked that the copy succeeded (first check then delete, always!) I deleted the directory (with a lot of subdirs) from my local harddisk and everything was fine…
That is, until I noticed that the items on the Navigation Column on the leftside of your Finder windows cannot be deleted if the dir or file they refer to are already removed?! This seems to be a bug/feature that can take one much time if the column is full of links and a lot of them are subdirs in a removed structure. So how to fix this?
The cure seems simple: recreate the directory structure and then remove the Navigation Column items and finally, remove the directory structure again. But if you have A LOT of files in that structure, it’s can be handy to copy the directory structure only. You can perform the structure-copying-magic by opening a new Terminal window on your Mac and type in the following command
[crayon-5e8de798ed455216246723/] The /path/from is the main directory that you want to clone the structure from. The /path/to/ is the target directory.
On the end of the statement there is the –include part that sets all the directories to be included. Last but not least the –exclude tells the command to exclude all files it encounters thus leaving the directories.
Bare in mind that you need to enter the target directory itself as a target, for instance:
- if path/from is /Users/Myusername/Development
- then set the /path/to to be /Newdirectory/Development