Relocating default directories with symbolic links (symlinks) #
While helping a friend setup his new 1TB RAID array, we discovered that iMovie '08 does not provide any apparent mechanism to change its default save directory (~/Movies). So we decided on the same technique I had previously used to move the Music, Pictures, and Movies folders out of a FileVault-encrypted home directory: symlinks. Wikipedia describes them best: "Symbolic links operate transparently: programs which read or write to files named by a symbolic link will behave as if operating directly on the target file." The following process worked great for our purposes, but please be aware that the slightest mistake or misunderstanding can cause irreparable data loss.
- Create Movies directory on RAID
$ mkdir /Volumes/RAID/Movies
- Move existing files and folders from ~/Movies to Movies on RAID
$ mv ~/Movies/* /Volumes/RAID/Movies/
- Delete the now empty ~/Movies folder so we can create the symbolic link
$ rmdir ~/Movies
- Create symbolic link named ~/Movies which points to the new location on RAID
$ ln -s /Volumes/RAID/Movies ~/Movies
UPDATE:
- List symlinks:
find . -type l -ls
- Find broken symlinks:
find -L . -type l -ls
- Delete a symlink:
unlink /path/to/symlink
/mac | May 23, 2008
Subscribe or visit the archives.