Symbolic links. Or cd to a particular location. Whatever.
Windows uses the same concept of home directories, for what it's worth. That's where your user profile lives -- all your user's customizations, configurations, bookmarks files, whatever. Windows puts it in C:\Documents and Settings\%username%, Linux puts it in /home/$username, OSX uses (what? /Users/$username? I'm not sure).
But the home directory really doesn't need to be for a user's data. It's for per-user configuration files. Your data can be anywhere. If you're a sole user, you could even have your external drives mounted directly under your $HOME directory in whatever fashion you like.
Personally, I use symbolic links, and mount all data-oriented partitions under /media. I have a /personal folder that organizes symlinks directly into the /media tree for most-used data, and duplicate those symlinks (or shortened versions of them) under my $HOME directory.
As a Superuser, you can use whatever form you like.
Windows supports drive mountpoints too (Microsoft calls them "reparse points", but the concept is the same). Since you are more familiar with Windows than with *NIX operating systems, here's a little experiment you can perform in Windows to help you understand the concept:
- Insert a USB flash drive into your computer.
- Create a new, empty folder on your desktop.
- Open up the Disk Management console, right-click your flash drive, and select
Change Drive Letters and Paths...
- In the dialog that comes up, hit the
Add...
button.
- Make sure the
Mount in the following empty NTFS folder:
button is selected, and browse to the path of that folder you created on your desktop (e.g. C:\Users\<your profile>\Desktop\New Folder
)
- Hit OK and OK. Now check out your desktop. You will see that the folder you created has a drive shortcut icon:
If you look at it from a command prompt window, you will see it as a <JUNCTION>
object type:
Note that your flash drive now has two mount points; E:
(or whatever) and that folder you created in step 2. You can remove the drive letter if you want, and you will still be able to copy files to/from it through the folder on your desktop. You can even add multiple drive letters for it if you want. This is what a mount point is: It's simply a path for you to access your drives/partitions.
Unlike Linux, Windows is representing this folder to you as some kind of oddball shortcut. Windows does this because mountpoints are a bit of a strange concept in Microsoft's world (hence your confusion). They don't even work properly in a lot of cases. But in *NIX operating systems, this is just the way things are done. A directory can be either a folder or a mountpoint in Linux, and most of the time the distinction between the two doesn't matter.
*NIX operating systems do not have a concept of drive letters. Your "root" filesystem (/
) is always at the top of the tree, and is (usually but not always) mounted as your system's boot drive. This is what C:\
is to Windows. There can only ever be one root (just like there can only be one C:
drive). Every other drive or partition on your system must be mounted to a path (directory) under this root. So, what would be D:
or E:
in Windows would be /mnt/D_Drive
, /media/cdrom
, or even /var
, /home
, or whatever in Linux.
Now this is an important thing, and is a big source of your confusion:
A device node is not the same thing as a mountpoint. Both Windows and Linux have device nodes. The difference is that Windows never shows them to you, and they do not exist as files on your hard drive the way they do in Linux.
In the command prompt screenshot above, you'll notice that the folder you created is listed as \??\Volume{GUID}\
. In both Linux and Windows the raw device itself has a device node (e.g. /dev/sda1
in Linux or \??\Volume{GUID}
in Windows). The mountpoint is the filesystem on that device. In Windows, you can think of drive letters (E:\
for example) as mountpoints for your drives/partitions. The only difference is that Windows never shows you the \??\Volume{GUID}
device node. It only shows you mountpoints, and those mountpoints are almost always drive letters (but, as we see from the experiment above, don't have to be).
I hope this clears things up for you.
Now, go back into Disk Management and delete that mountpoint before you accidentally do something stupid, like trying to copy/move it somewhere! :-)
Best Answer
OS X has both a user-friendly directory structure (with top-level folders named
/Applications
,/System
,/Users
,/Library
), as well as a standard Unix directory hierarchy that is hidden in Finder (/bin
,/etc
,/var
,/usr
, ...) — those folders are documented inman hier
.Additionally, there are differences between the Unix directories (at least as used in OS X), and those you'd find in Linux: For example, the latter has
/srv
.The best explanation is probably in the developer documentation by Apple, which is too long to be quoted here. Note that at the moment, the linked article is both for iOS (at the top) and OS X (further down).
Where to place files also depends on the realm the application comes from: It makes sense to place Unix libraries in
/usr/local/lib
or similar directories, while OS X libraries would be e.g. in/Library
or similar. Some tools (Perl, Python, Ruby) were configured to work with the latter file system structure.