File Management and User Permissions
Throughout this class you will be creating and managing many files on both Windows and UNIX operating systems. The purpose of this short tutorial is to establish basic file management skills, familiarize you with common file management concepts and terms, and introduce UNIX file permission settings.
Basic File Management Concepts
Everyone is familiar with Windows "My Computer" file management tool. When you click the Folders button, you are able to view the storage components of your PC. Clicking the Expand icon next to the C Drive icon expands the the view to display the folder and file hierarchy on your hard drive, which has been assigned the letter C: C is considered a root folder, and the folders on C: subfolders that allow the hundreds or thousands of files on your computer to be organized. These concepts are common to all operating systems -except that on a UNIX system (a computer that is running the UNIX operating system rather than Microsoft Windows or some other operating system) folders are called directories and subfolder, subdirectories.
If you expand the Documents and Settings folder on C:, you will see increasingly refined subfolders which include user accounts. If you are working on your own computer, you will probably find your username here. In your account folder you will find folders that store "My Documents", "Desktop", and other resources specific to your use.
Consider the folder hierarchy (sometimes called a tree) illustrated to the left. Suppose that there was a file in the Addresses folder called addressbook.mdb. Suppose that you were out of town and needed your roommate to send your addressbook.mdb. file to you via email. How would you be able to notate the location of this file?
To illustrate where a file exists on a particular system we use a path specification(Microsoft simply calls it an address). The path to the addressbook.mdb file would be notated as follows:
C:\Documents and Settings\Kenneth Baldauf\My Documents\Addresses\addressbook.mdb
A couple things to note here. Notice that Microsoft uses backslashes to indicate levels of the hierarchy. UNIX uses forward slashes. Since most Web servers use the UNIX O/S, Web addresses also use forward slashes. Also notable is that UNIX does not permit spaces to occur in file or directory names. Windows does. So any Windows file that has spaces in its name will need to be renamed when transferred to a UNIX system. Also worth noting is that Windows is not case sensitive, but UNIX is. So http://www.cs.fsu.edu/~baldauf is recognized by a UNIX Web server, but http://www.cs.fsu.edu/~BALDAUF is not.
Short exercise: Open Windows Notepad (in Start > Programs > Accessories). No need to type anything in the document, simply save it using the following specifications:
The reason that the Web runs predominantly on UNIX, is that UNIX provides excellent security -methods of specifying exactly who is permitted to view, run, and edit each file and directory. We will need to learn how to set these permissions for files and directories in order to allow the world to view our Web pages.
UNIX access permissions are indicated using rwx to indicate (r)ead, (w)rite, and e(x)ecute. Read and write permissions are self-explanatory, execute differs for files and folders (called directories in UNIX). For files, execute is used to allow you to run a program file. For directories, execute is used to allow users to view the contents of the directory.
There are three sets of permission settings (rwx) for each file and directory. One for the owner of the file, one for a specified group (your group is students at FSU), and one for the world (everyone with access to garnet). Examples: rwxrwxrwx grants read, write, and execute permission to the owner, group, and world, rwx------ indicates that only the owner has permission to read, write, and execute the file or directory (the dashes indicate no permission). Here are more examples...
Below is an illustration of how files and folders look when listed from the UNIX command line:
Sometime the rwx sequence is prefixed by a "d" indicating that the item is a directory, not a file. By default all home directories are set to drwx------ so that only the owner can access what is in it.
In this example kbaldauf is listed as the owner of each file and directory, and the group kbaldauf belongs to is cs (for computer science). File and directory names are listed on the far right. Also, file size, and last edited date are provided.
In UNIX we can use the chmod command at the UNIX command line to set permissions, or a graphics user interface such as the one provided with Secure File Transfer Client. Assignment 1 shows how to view and set permissions.