Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Linux File System Layout


  • Please log in to reply
6 replies to this topic

#1 american.swan

american.swan

  • Members
  • 30 posts
  • OFFLINE
  •  
  • Local time:10:23 PM

Posted 05 April 2008 - 09:00 PM

I have search the net many times and found document after document explaining each section of the Linux file system.

I read these long documents and I guess I have to just brute memorize where everything goes.

Could someone please explain WHY Linux does it that way? WHY? I don't want to know where web viewable folders are. I want to know WHY there there.

Windows is so simple. Windows director. Program Files directory. It seems straight forward. Linux is a totally different animal.

If you ask someone why Microsoft office is installed in the Program Files directory of windows everyone and his cousin can tell you why. Cause it's a program. Duh. If you install Open Office on Linux on the other hand, I for one have no idea where the files are and even if I did know where they were installed to...I don't know the WHY...the rational for why Mr. Linux himself decided to put them there.

Can someone please explain the WHY? Why is linux' file system the mess it is. Because if I understand WHY...it wouldn't be a mess anymore.

BC AdBot (Login to Remove)

 


#2 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:23 AM

Posted 06 April 2008 - 06:01 AM

A very good question, in my option. According to my reading, the Linux directory structure (which is based on the Unix structure) aims to adhere to the "File System Hierarchy Standard" (AKA the "FSSTND"). If you're feeling bold, you can try banging your head against it for a while at: http://www.pathname.com/fhs/pub/fhs-2.3.html

The short-short answer is that it draws influences from many different systems, is designed by a consensus of various Linux Gurus, and tries to be as logical and efficient as possible while keeping files grouped by purpose rather than by parent application (e.g. all documentation files are in one spot, all executables in another, etc. regardless of what program installed them.) Plus there's the need to keep some files (like powerful administration tools) separate from others in places that only the root user is supposed to be able to access.

Further reading for the terminally curious:
http://tldp.org/LDP/Linux-Filesystem-Hiera...html/index.html
http://rute.2038bug.com/node38.html.gz

The above links lead to rather long and thick documents describing the standard. For a somewhat concise version, read the "forward" to the first document.

Edited by Amazing Andrew, 06 April 2008 - 06:04 AM.


#3 Joedude

Joedude

  • Members
  • 337 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sutton Coldfield, West Midlands, England
  • Local time:02:23 PM

Posted 06 April 2008 - 06:24 AM

It takes that further and seperates system files from user files so that permissions remain integrous without affecting the system application. In other words, when you make a change, in general, to how an application runs, that change is made in your home folder. For everyone else on the system it will run as it's defaults make it until they change it for their home systems. This way, as can happen in windows, you rarely run into the messed up permissions problem which prevents you from doing something.

Also, as far as file altering, like viruses, spyware, and the like, they can not hurt your system files at all because unless you are running as root, they have no access to them. They can only affect your home folder. Not that there are a lot of Linux exploits that a non server user would have to concern himself with anyway.
If someone tells you to su rm -rf /
DON'T DO IT!!!!
Be in the know, Bash smart!

#4 Trio3b

Trio3b

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:06:23 AM

Posted 06 April 2008 - 09:56 PM

The preceding two answers are probably the most important. One more is answered in the form of a question.

Have you ever tried to remove an application in Windows and you get that little notification box that Windows could not remove all the files and you may have to poke thru the system in various locations and remove them manually?

Edited by Trio3b, 06 April 2008 - 10:02 PM.


#5 american.swan

american.swan
  • Topic Starter

  • Members
  • 30 posts
  • OFFLINE
  •  
  • Local time:10:23 PM

Posted 07 April 2008 - 12:40 AM

The preceding two answers are probably the most important. One more is answered in the form of a question.

Have you ever tried to remove an application in Windows and you get that little notification box that Windows could not remove all the files and you may have to poke thru the system in various locations and remove them manually?


I guess I have gotten that quite often. One example is if I open a media file and the file fails to open properly and I want to delete it. It won't let me because it's still claims to be in use.

I generally don't have that problem when removing a program, but I definitely know what your talking about.

How is that linked with Linux?

Linux lets you delete whatever file you want if your have the right permissions. Same for programs. What does that have to do with anything?

#6 Trio3b

Trio3b

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:06:23 AM

Posted 10 April 2008 - 11:25 PM

Another link here.

An excerpt:

"This kind of layout, known as the unified filesystem, does offer several
advantages over the approach that Windows uses. Let's take the example of
the /usr directory. This directory off the root directory contains most of
the system executables. With the Linux filesystem, you can choose to mount
it off another partition or even off another machine over the network. The
underlying system will not know the difference because /usr appears to be
a local directory that is part of the local directory structure! How many
times have you wished to move around executables and data under Windows,
only to run into registry and system errors? Try moving c:windowssystem
to another partition or drive."


Although there may be some elements of tradition, according to this article there is flexibility compared to other file systems. I guess you know that as a rule Linux filesystems are less susceptible to fragmentation. It is somewhat confusing for the new user, but on any arbitrary scale it is no less "learnable" than any other system.

Hopefully this explains some of the why you are seeking.

Edited by Trio3b, 10 April 2008 - 11:30 PM.


#7 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:23 AM

Posted 11 April 2008 - 03:14 AM

I guess you know that as a rule Linux filesystems are less susceptible to fragmentation.


Actually, this is independant of the directory structure and is a feature of several of the filesystems used for Linux such as EXT2 and EXT3. http://geekblog.oneandoneis2.org/index.php...d_defragmenting




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users