If you’re a Linux (or even a Mac) command-line person, you’re probably already familiar with the concept of filesystem links and the “ln” command. In short:
- A file is really just a collection of information on your hard disk.
- A directory entry is just a kind of pointer with a name that points to the information on disk.
So far, so good. Here’s the point that most don’t realize:
- There’s nothing wrong with having more than one directory entry point to the same information on disk.
In other words, the same file (or folder) can appear to be in two places at once.
What most folks also don’t realize is that Windows has the same capability as part of the NTFS filesystem; it’s just been under-advertised.
Here’s a practical example. I don’t like that OneDrive strongly insists on using “c:\users\<loginname>\OneDrive”. I much prefer to have my OneDrive folder at the root of my C: drive, as in “C:\OneDrive”.
So, in a Windows Command Prompt (run as administrator) I navigated to C:\, and then entered:
mklink /D OneDrive C:\Users\lnote\OneDrive
This created C:\OneDrive, which is a symbolic link1 to C:\Users\lnote\OneDrive. Either can be used interchangeably, almost any time I need to reference the contents of my OneDrive folder. Now it appears at the root of my C:\ drive, alongside my “C:\DropBox” and other similar folders.
Aside from my personal, somewhat anal-retentive need to have these folders at the root of my C:\ drive, you may find the whole concept of file linking, and the mklink utility, a handy addition to your command-line toolbox.