{"id":925,"date":"2007-11-13T21:58:17","date_gmt":"2007-11-13T21:58:17","guid":{"rendered":"http:\/\/scienceblogs.com\/gregladen\/2007\/11\/13\/fun-with-linux-the-existential\/"},"modified":"2007-11-13T21:58:17","modified_gmt":"2007-11-13T21:58:17","slug":"fun-with-linux-the-existential","status":"publish","type":"post","link":"https:\/\/gregladen.com\/blog\/2007\/11\/13\/fun-with-linux-the-existential\/","title":{"rendered":"Fun with Linux: The Existential File System"},"content":{"rendered":"<p>The Linux file system is very different from that found in other systems.  You use Linux files all the time, because most of the time that your browser &#8220;gets&#8221; a web page, it is accessing a Linux file system.  Here, I just want to point out a few cool things about the system.  In some ways, the system is annoyingly complex, but for good reasons.  Some of the key differences between, say, the Linux system and the Windows\/DOS system are the very reasons that it is fairly easy to set a virus or other damaging bit of code loose in a Windows computer but difficult in a Linux computer.<!--more-->In Unix\/Linux, all filenames are pointers, or links, to files.  A file consists of a bunch of data on a disk, but the file does not exist unless it is named.  &#8220;I have a name therefore I am&#8221; is what the file says.  If you delete the name, the file ceases to exist, even though it is still there.That is not too different from other file systems, but there is an interesting twist.  There is no theoretical limit on the number of filenames that may be linked to a given file.  (There are system-wide limits that are usually very large, like 512 maximum number of names per file, etc.)So let&#8217;s say I have a file on a linux system named foo.txt.  I can then give it another name, perhaps bar.txt. Now there is one file with two names.  If I delete foo.txt, the file remains untouched, it has simply reverted to a file with one name (but not the original name).This allows Linux systems to do all sorts of interesting things, as you can imagine.  Other systems have &#8220;links&#8221; or &#8220;shortcuts&#8221; but they are not real. The Linux links are all of identical status.  There is no practical way to tell the difference between two different filenames that are pointing to the same file.  This allows Linux systems to do all sorts of interesting things, as you can imagine.For example:  On the typical Unix systems and many Linux systems, there are many different users.  Each user has separate &#8220;home&#8221; space where files are kept, and these spaces are strictly separated.  One way to keep this separation true, but to co-own data, is to share a file by giving it two names, one in each of two user&#8217;s spaces.  Under these conditions, each user independently controls whether the file exists or does not exist, from the perspective of that user&#8217;s home space.  It&#8217;s all very post modern.However, this cool feature only works within a given file system.  That makes sense because the existential reality of a file exists in a table kept on one file system that connects the name to the actual file.  This is at the heart of the Linux system of security and management of data.  It would be very stupid to have this key feature duplicated across a network. From a system administrators point of view, you might as well drop your pants and bend over in the Republican Cloakroom in DC.The file system is restricted physically (as in physical disks) and in ways that I do not understand in relation to a given system. But people using computers collaborate across this boundary all the time.  So, Unix gurus invented a thing called the &#8220;symlink&#8221; (symbolic link).  The job of the simlink is to &#8230; simulate a link!Now, if you make foo.txt, then add the name bar.txt as a simlink, then delete foo.txt, then, bar.txt is an orphan.  It points to nothing.  That is like the Windows &#8220;shortcut.&#8221;OK, that&#8217;s enough.  I know you are drooling for more interesting information about Linux files but it will have to wait.  Next time:  How the way Linux file systems work determines how the world wide web works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Linux file system is very different from that found in other systems. You use Linux files all the time, because most of the time that your browser &#8220;gets&#8221; a web page, it is accessing a Linux file system. Here, I just want to point out a few cool things about the system. In some &hellip; <a href=\"https:\/\/gregladen.com\/blog\/2007\/11\/13\/fun-with-linux-the-existential\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fun with Linux: The Existential File System<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"1","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[67],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5fhV1-eV","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/925"}],"collection":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/comments?post=925"}],"version-history":[{"count":0,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/925\/revisions"}],"wp:attachment":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/media?parent=925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/categories?post=925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/tags?post=925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}