File System Design


Unix's file system is one of the strongest and most flexible in use today. This file system was made for power and not for ease of use, so navigating it can seem somewhat cryptic. Try not to worry, however, because the purpose of this lesson is to help eliminate any potential confusion. In this section of the lesson, we will take our first step toward that goal by looking at some of the design features that make up the Unix file system.

In Unix, the file system is laid out so that there is a single root directory. This is unlike Microsoft Windows, for example, where Windows will have multiple drive letters such as C:\, D:\, and so on. From the single root directory in the Unix file system, the file tree sprouts. A sample file system tree can be seen in Figure 4.1.

Figure 4.1. Sample Unix file system tree.


The root directory should not be confused with the all-powerful administrator account called "root," which we learned about when we learned how to log in to Unix in Lesson 1, "Getting Started."

Get to the Root of the Problem, but Which Root? Remember, in Unix, the person with absolute control over everything having to do with the machine is the root user. The root user should not be confused with the root directory, which is the one specific directory on the machine that is considered to be the base of the file system. Try not to confuse these two definitions.


Another interesting fact about Unix's file system design is that installed hard disks do not show up as drives in Unix. In Windows they do, but in Unix, installed hard disks are viewed as directories within the file system. In some people's opinion, this is easier to understand than the Windows method. Here, if you have a drive installed on your system, you can quickly change from your current location to this other drive just by entering the correct command at the shell prompt. Unix completely removes the end user's concern regarding what hardware is installed on the system and the physical location of the files he or she wants to access. One of the benefits of this design is that if you have a disk failure (where a hard drive ceases to function), then you are back in business as quickly as the disk can be replaced and remounted (this is a task for your Unix system administrator). Another benefit to this design is that you can quickly and easily find what you need in the file system right at the shell prompt, which we will shortly learn to do.

Unix commands, as we already discussed, are case sensitive, so the principle for searching for files is the same as that for executing them: You have to be specific.

Don't Be So Sensitive When learning Unix, always consider case sensitivity, no matter whether you are entering a command or searching for data. So many new users of Unix are accustomed to Windows and other operating systems that are generally not dependent on case sensitivity because they were built for ease of use. Unix, the powerhouse among operating systems, must be approached a different way.


Another aspect of Unix's file system design is its approach to file attributes. For those of you familiar with Microsoft Windows, attributes are characteristics assigned to files or folders that provide you some form of access control over the data. For instance, if you have a file that you don't want anyone to alter, you can make the file "read only." This ensures that if other people look at the file, they can't change it. In much the same way as Windows files, Unix files use three such attributes:

  • Read

  • Write

  • Execute

In Unix,these three attributes can all be used in the negative form as well. In other words, you can make a file readable or unreadable, writable or not writable, executable or not executable. In most cases, files used for data will be designated as readable and writeable, and programs will be marked as readable and executable. This, however, is not a ruleit is simply what you are most likely to see in the types of files you are working with right now.

There's one last tip you should keep in mind when working in the Unix file system: You have to be careful when asking Unix to do something. Although you shouldn't be afraid of Unix, you have to consider that it does not have as many "checks" built into it as other operating systems. For example, if you try to change or delete something when working in Microsoft Windows, the operating system double checks with you to make certain that this is really what you want to do. This is not going to happen when you are typing commands into the Unix shell prompt. Thus, if you are practicing on a live system, be careful. Again, it's always recommended that you get a copy of Unix or Linux and practice in a lab so that you can make mistakes and not have to worry about them negatively affecting the system.

So, now that you feel comfortable with the design of the Unix file system, let's take a look at how to navigate it and at what commands you can use to unleash Unix's power.



    SAMS Teach Yourself Unix in 10 Minutes
    Sams Teach Yourself Unix in 10 Minutes (2nd Edition)
    ISBN: 0672327643
    EAN: 2147483647
    Year: 2005
    Pages: 170

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net