Create a Virtual File Gallery with Symlinks
Creating a directory that is a union of several directories can be achieved
with a few symlinks at the command line.
Creating a Virtual File Gallery # [1]
Here is how I am creating a virtual directory of all my projects that is a
combination of both work and not-work projects. I am creating symlinks for
every directory under ~/work and ~/git.
rm -rf ~/projects
mkdir ~/projects
ln -sf ~/work/* ~/projects
ln -sf ~/git/* ~/projects
⚠ Notice that first I am recreating the directory each time. This will ensure
that any project that is deleted from their actual directory is removed from
the virtual gallery.
Updating the gallery # [2]
Since links are always kept up to date without any extra work, all the data is
still in the same place it started. But as new directories are added to any
project directory they will not be automatically added to the virtual gallery.
- cron
- bashrc/zshrc
If you’re concerned about system resources, you can add it to a cron job to run
at a regular sch...