The big difference between Linux and Windows, at least when it comes to their filesystems and directory trees is that in Linux "everything is a file", and everything descends from a single root. This also applies to almost all Unix-derived OSes such as BSD, OS X, Solaris, etc., but I'm going to just say "Linux" to be generic (if not entirely accurate).
But what does that mean in practice?
Windows allows for multiple named roots for their filesystems. You understand these as drive letters: C: D: E:
and so on. Each one has a root (\
), and a tree that descends from it. Recent versions of Windows allow for things like volume mountpoints, where a volume (what you'd consider a partition) can be mounted to an existing, empty folder. So instead of D:
\ representing the root of, say, your optical (CD/DVD/BR) drive, you could mount it at C:\Optical
instead. This is more similar to what Linux does. There's also an underlying, single-rooted, object namespace for everything in Windows similar to what Linux uses and is managed by the Object Manager, but most users rarely see it referenced since it's primarily for kernel use.
Linux has a single root: /
. Everything descends from it, and it doesn't necessarily need to represent your hard drive. Hard Drives, Optical Drives, Memory Cards, Network Shares, Printers, Scanners, CPUs, RAM, Processes, ... everything is represented somewhere inside this single namespace, and can be access by any process with standard file management APIs, presuming you have a high enough level of access. Just because you can read or write from it doesn't mean it's a file on your hard drive in Linux. For example, devices are typically mounted into /dev
, so accessing things in there often means you're talking to a device -- maybe it's the sound card, or a scanner, or a camera, etc. These are known as device files. Procfs is a special "filesystem" that's normally mounted to /proc
and has a "directory" for every running process, with files in each directory relating to things like the command line used to invoke that process, memory maps, open files, etc. Sysfs is another special filesystem (mounted on /sys
) used to expose a wealth of information about the running kernel objects and can also be used to fine-tune the running kernel by simply writing to a particular file.
/
. In Windows, this is not the case, as it lacks UNIX-style mounting (correct me if I'm wrong here), so everything is organized around drives.