<p>I'll admit that I don't know the inner workings of the unix operating system, so I was hoping someone could shed some light on this topic.</p>

<p>Why is the Unix file system better than the windows file system?</p>

<p>Would grep work just as well on Windows, or is there something fundamentally different that makes it more powerful on a Unix box?</p>

<p>e.g. I have heard that in a Unix system, the number of files in a given directory will not slow file access, while on Windows direct file access will degrade as the # of files increase in the given folder, true?</p>

<p>Updates:
Brad, no such thing as the <a href="http://en.wikipedia.org/wiki/Unix_File_System" rel="noreferrer">unix file system</a>?</p>

[{'answer_id': 35601, 'author': 'Paul Tomblin', 'author_id': 3333, 'author_profile': 'https://Stackoverflow.com/users/3333', 'pm_score': 0, 'selected': False, 'text': "<p>I don't know enough about the guts of the file systems to answer the first, except when I read the first descriptions of NTFS it sounded an awful lot like the Berkley Fast Filesystem.</p>\n\n<p>As for the second, there are plenty of greps for Windows.  When I had to use Windows in the past, I always installed Cygwin first thing.</p>\n"}, {'answer_id': 35605, 'author': 'Zameer Manji', 'author_id': 2874, 'author_profile': 'https://Stackoverflow.com/users/2874', 'pm_score': 2, 'selected': False, 'text': '<p>I think you are a little bit confused. There is no \'Unix\' and \'Windows\' file systems. The *nix family of filesystems include ext3, ZFS, UFS etc. Windows primarily has had support for FAT16/32 and their own filesystem NTFS. However today linux systems can read and write to NTFS. More filesystems <a href="http://en.wikipedia.org/wiki/List_of_file_systems" rel="noreferrer">here</a></p>\n\n<p>I can\'t tell you why one could be better than the other though.</p>\n'}, {'answer_id': 35606, 'author': 'Brad Wilson', 'author_id': 1554, 'author_profile': 'https://Stackoverflow.com/users/1554', 'pm_score': 3, 'selected': False, 'text': '<p>First, there is no such thing as "the Unix file system".</p>\n\n<p>Second, upon what premise does your argument rest? Did you hear someone say it was superior? Perhaps if you offered some source, we could critique the specific argument.</p>\n\n<p><strong>Edit:</strong> Okay, according to <a href="http://en.wikipedia.org/wiki/Comparison_of_file_systems" rel="noreferrer">http://en.wikipedia.org/wiki/Comparison_of_file_systems</a>, NTFS has more green boxes than both UFS1 and UFS2. If green boxes are your measure of "better", then NTFS is "better".</p>\n\n<p>Still a stupid question. :-p</p>\n'}, {'answer_id': 35608, 'author': 'Ethan Gunderson', 'author_id': 2066, 'author_profile': 'https://Stackoverflow.com/users/2066', 'pm_score': 1, 'selected': False, 'text': "<p>well the *nix filesystems do a far better job of actual file managment than fat16/32 or NTFS.  The *nix systems try to prevent the need for a defrag over windows doing...nothing?  Other than that I don't really know what would make one better than the other.</p>\n"}, {'answer_id': 35616, 'author': 'Greg Hewgill', 'author_id': 893, 'author_profile': 'https://Stackoverflow.com/users/893', 'pm_score': 4, 'selected': False, 'text': "<p>One of the fundamental differences in filesystem semantics between Unix and Windows is the idea of inodes.</p>\n\n<p>On Windows, a file name is directly attached to the file data. This means that the OS prevents somebody from deleting a file that is currently open. On some versions of Windows you can rename a file that is currently open, and on some versions you can't.</p>\n\n<p>On Unix, a file name is a pointer to an inode, which is the place the file data is actually stored. This has a couple of implications:</p>\n\n<ul>\n<li>You can have two different filenames that refer to the same underlying file. This is often called a <em>hard link</em>. There is only one copy of the file data, so changes made through one filename will appear in the other.</li>\n<li>You can delete (also known as <code>unlink</code>) a file that is currently open. All that happens is the directory entry is removed, but this doesn't affect any other process that might still have the file open. The process with the file open hangs on to the inode, rather than to the directory entry. When the process closes the file, the OS deletes the inode because there are no more directory entries pointing at it and no more processes with the inode open.</li>\n</ul>\n\n<p>This difference is important, but it is unrelated to things like the performance of <code>grep</code>.</p>\n"}, {'answer_id': 35618, 'author': 'Scott Dorman', 'author_id': 1559, 'author_profile': 'https://Stackoverflow.com/users/1559', 'pm_score': 1, 'selected': False, 'text': '<p>There are differences in how Windows and Unix operating systems expose the disk drives to users and how drive space is partitioned.</p>\n\n<p>The biggest difference between the two operating systems is that Unix essentially treats all of the physical drives as one logical drive. (This isn\'t exactly how it works, but should give a good enough picture.) This allows a much simpler file system from the users perspective as there are no drive letters to deal with. I have a folder called /usr/bin that could span multiple physical drives. If I need to expand that partition I can do so by adding a new drive, remapping the folder, and moving the files. (Again, somewhat simplified, but it gets the point across.)</p>\n\n<p>The other difference is that when you format a drive, a certain amount is set aside (by default, as an admin you can change the size to 0 if you want) for use by the "root" account (admin account) which allows an admin to almost always be able to log in to the machine even when the user has filled the disk and is receiving "out of disk space" messages.</p>\n'}, {'answer_id': 35627, 'author': 'cpm', 'author_id': 3674, 'author_profile': 'https://Stackoverflow.com/users/3674', 'pm_score': 2, 'selected': False, 'text': '<p>I\'m not at all familiar with the inner workings of the UNIX file systems, as in how the bits and bytes are stored, but really that part is interchangeable (<a href="http://en.wikipedia.org/wiki/Ext3" rel="nofollow noreferrer">ext3</a>, <a href="http://en.wikipedia.org/wiki/ReiserFS" rel="nofollow noreferrer">reiserfs</a>, etc).</p>\n\n<p>When people say that UNIX file systems are better, they might mean to be saying, "Oh ext3 stores bits in such as way that corruption happens way less than NTFS", but they might also be talking about design choices made at the common layer above. They might be referring to how the path of the file does not necessarily correspond to any particular device. For example, if you move your program files to a second disk, you probably have to refer to them as "D:\\Program Files", while in UNIX /usr/bin could be a hard drive, a network drive, a CD ROM, or RAM.</p>\n\n<p>Another possibility is that people are using "file system" to mean the organization of paths. Like, for instance, how Windows generally likes programs in "C:\\Program Files\\CompanyName\\AppName" while a particular UNIX distribution might put most of them in /usr/local/bin. In the later case, you can access much more of your system readily from the command line with a much smaller PATH variable. </p>\n\n<p>Also, since you mentioned grep, if all the source code for system libraries such as the kernel and libc is stored in /usr/local/src, doing a recursive grep for a particular error message coming from the guts of some system library is much simpler than if things were laid out as /usr/local/library-name/[bin|src|doc|etc]. If you already have an inkling of where you\'re searching, though, cygwin grep performs quite well under Windows. In fact, I find for full-text searching I get better results from grep than the search facilities built into Windows!</p>\n'}, {'answer_id': 215388, 'author': 'Joshua', 'author_id': 14768, 'author_profile': 'https://Stackoverflow.com/users/14768', 'pm_score': -1, 'selected': False, 'text': '<p>The answer turns out to have very little to do with the filesystem and everything to do with the filesystem access drivers.</p>\n\n<p>In particular, the implementation of NTFS on Windows is very slow compared to ext2/ext3. Also on Windows, "can\'t delete file in use" even though NTFS should be able to support it.</p>\n'}, {'answer_id': 10664449, 'author': 'mtk', 'author_id': 1135954, 'author_profile': 'https://Stackoverflow.com/users/1135954', 'pm_score': 1, 'selected': False, 'text': "<p>One simple answer:</p>\n\n<p><code>Windows</code> is a proprietary which means no one can see it's code except windows, while <code>unix/linux</code> are open-source. So as it is open-source many <em>brighter</em> minds have contributed towards the filesystem making it one of the robust and efficient, hence effective commands like grep come to our rescue when needed truly.</p>\n"}]
['https://Stackoverflow.com/questions/35599', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1368/']