Disclaimer: I work with programmers, but am not one myself and have no real / formal knowledge of how an OS works; please be patient if the following makes plain my ignorance :)

I am trying to organize a large group of folders that contain many different subfolders and documents (full context is provided below, in case it is helpful / relevant).

I'm trying to avoid duplication of folders/documents but it would be most convenient for many folders/documents to be "filed" in multiple places. As such, I was thinking of using either symbolic links or aliases, but was wondering which would be most appropriate / robust to ongoing development and changes?

I'm not very clear on the difference between the two (from what I have read, a Mac alias is a kind of symbolic link, but with different behaviour). However, while working on other projects where, e.g. an app calls on a script which may be intermittently updated by my programmer, I know we had to make use of a symbolic link to avoid issues when the file was updated (& an alias would not work, in that case).

All these files are currently stored on DropBox, in case that adds additional complications.

Any suggestions would be very much welcome, including pointers on structuring / organizing files optimally. I find that I am constantly pulled between having well-organized folders and quick access to those folders / documents, and imagine there must be a solution that allows for both!


Context: the following may or may not be relevant to the proposed solution and is only included for completeness.

I am teacher, and create a new folder for each class (8-12 classes/semester); within which I create updated versions of my notes (which are done in LaTeX, so are grouped in separate folders, for each lecture); new resources to incorporate in the future; questions from students and other related info.

During any given semester, my work lives almost exclusively in the course-folder for that semester, so I try to ensure that all, and only, relevant files are in that folder for the duration of the semester.

Any unused resources or projects that have to be carried forward are generally moved to a class-resources folder that is carried forward from semester-to-semester. It would be convenient, however, to make this process less demanding to maintain (e.g. having the resources folder as a symbolic link of the folder in each semester, so that material to be carried forward is automatically filed there and can be found within any semesters folder).


Solution 1:

Aliases store two pieces of information about the destination file - both the location and a file identifier. Symbolic links only store the other location. For that reason, if you move a file, Aliases are superior since they can often still point at the correct file when a change happens.

Dropbox or moving the files to another filesystem is where things get really messy - what works on one filesystem will often break in another.


As to your overall file organization and filtering / search problem, that's going to be much trickier thing to answer - you'll need something like 20 questions and back and forth discovery with one or more people. There will be no correct answer either since what would work for 4 years of curriculum might fold like a house of cards if you have 25 years of files. Similarly - designing something for 3 TB of digital media would be overkill for someone that worked in thin file formats like markdown text and simple file references to still images and short clips of animation.

Think about a couple things when you look at why your current workflow is failing you:

  1. Can you use spotlight search effectively. For advanced skills, think spending 3 or 4 hours in 30 minute classes over a couple weeks with people that know search, smart folders, tagging, advanced search to find files by date range, EXIF data in images, by size or format. Maybe you have a fine folder structure and could beef up search so you don't need to move files - just put them where they live and find then quickly / used filtered views to locate things you'll need ad hoc during class or lesson prep.
  2. Do you have a good backup strategy. If you do - just delete things you don't need so you don't need to be a search wizard. When you need something - restore it and go (or put it in the cloud so you can restore or browse the archives for an occasional "miss" on what you need in your working set of files. Box.com / Dropbox / iCloud / Google drive complicate this immensely as sync isn't really backup and backup certainly isn't sync. The more you optimize for [search/sync/backup/organization], the more the other aspects suffer in my experience.
  3. Are you working around key applications that miss features. Many applications can handle files stored in other places and plain text is so small you could carry around plain text of the entire Project Gutenberg library of 56,000 ebooks in 900 MB. It downloads in about 45 seconds for me so your situation might need a different way to index and organize based on what your requirements for files and apps are truly. (TeX is notoriously messy in spewing files all over the place - and I did my thesis in LaTeX - I would be hard pressed to use that now for a body of work that needed to be synced / grow / link over years. Perhaps Apple Notes and other apps fill in for things that can't live in plan text / markdown / pdf.)

Please don't take any of these comments as criticism of your effort and plans. I would expect you've thought deeply about how you work and would have changed if it made sense, but it's going to be hard to have an answer here that's broadly applicable to everyone that reads your post other than outlining some of the relevant items to consider and weigh how those items affect anyones current or ideal or optimized workflow.

Solution 2:

If you wish to have the same file appear in more than one folder, then then go ahead and do that. You do not need an alias or symbolic link.

When a file is created, a filename is put in a folder and the a link is created between the filename and the file. If you wish, you can create more than one link.

For example, say the only visible file in a folder is named a.txt. In the example, this file contains 9 bytes. If the ls -li command is entered, then the following output is produced.

total 8
3798081 -rw-r--r--  1 davidanderson  staff  9 Apr 22 09:28 a.txt

This output shows the serial (inode) number of file named a.txt is 3798081 and the number links is 1. The filename b.txt can be linked to this same file be entering the command given below.

link a.txt b.txt

Below is the output from the command ls -li.

total 16
3798081 -rw-r--r--  2 davidanderson  staff  9 Apr 22 09:28 a.txt
3798081 -rw-r--r--  2 davidanderson  staff  9 Apr 22 09:28 b.txt

Both filenames a.txt and b.txt have the same inode number. Furthermore, the link count for both filenames is 2. You can now move b.txt to a different folder, then rename b.txt to a.txt.

To show both a.txt and b.txt link to the same file, one can compare the results from copying the file. If the command cp a.txt c.txt is entered, then the ls -li command would produce the following output.

total 24
3798081 -rw-r--r--  2 davidanderson  staff  9 Apr 22 09:28 a.txt
3798081 -rw-r--r--  2 davidanderson  staff  9 Apr 22 09:28 b.txt
3798333 -rw-r--r--  1 davidanderson  staff  9 Apr 22 10:20 c.txt

Here, filename c.txt has been assigned a different inode number and the link count for filenames a.txt and b.txt remains at 2.

I should point out the behavior when a multi-linked file is edited. Some editors (such as nano) would save changes to the same file, so the linking would not change. The TextEdit application would create a new file. So for example, if the command open -a TextEdit.app a.txt was used to change the file, then the output from the ls -li command would appear as follows.

3798637 -rw-rw-rw-@ 1 davidanderson  staff  13 Apr 22 10:52 a.txt
3798081 -rw-rw-rw-@ 1 davidanderson  staff   9 Apr 22 10:51 b.txt
3798333 -rw-r--r--  1 davidanderson  staff   9 Apr 22 10:20 c.txt

Here all three filenames link to different files and the link counts are all set to 1.