Chapter 9. Filesystem Structure

Table of Contents
Ownership
Permissions
Links
Mounting Devices
NFS Mounts
Summary

We have already discussed the directory structure in Slackware Linux. You are able to find files and directories that you need. But there is more to the filesystem than just the directory structure.

Linux is a multiuser operating system. Every aspect of the system is multiuser, even the filesystem. The system stores information like who owns a file and who can read it. There are other unique parts about the filesystems, such as links and NFS mounts. This section explains these, as well as the multiuser aspects of the filesystem.

Ownership

The filesystem stores ownership information for each file and directory on the system. This includes what owner and group own a particular file. The easiest way to see this information is with the ls command:

   $ ls -l /usr/bin/wc
   -rwxr-xr-x   1 root     bin    7368 Jul 30  1999 /usr/bin/wc
   

We are interested in the third and fourth columns. These contain the username and group name that owns this file. We see that the user “root” and the group “bin” own this file.

We can easily change the file owners with the chown(1) (which means “change owner”) and chgrp(1) (which means “change group”) commands. To change the file owner to “daemon”, we would use chown:

   # chown daemon /usr/bin/wc
   

To change the group owner to “root”, we would use chgrp:

   # chgrp root /usr/bin/wc
   

We can also use chown to specify the user and group owners for a file:

   # chown daemon.root /usr/bin/wc
   

File ownership is a very important part of using a Linux system, even if you are the only user. You sometimes need to fix ownerships on files and device nodes.