University of Rhode Island HomeUniversity DirectoriesUniversity Fast Linkse-CampusDepartment HelpDepartment Webmail Server
Department Home

Before you start, you have to log on to the system using your account. Then you need to get to a command prompt. If you used telnet to login from a remote location then you will already be at the prompt. If you used one of the computers in the the lab running X Windows, you can type in commands in the Xterm window. When you see a prompt that resembles the following,
1 (leviathan) /ugrads/username>
type ls -la. This will display the contents of your home directory

1 (leviathan) /ugrads/username> ls -la
total 34
drwxr-x---   9 username groupname    512 Feb 21 14:10 ./
drwxr-xr-x 177 root     other       4608 Feb 14 10:46 ../
-rw-------   1 username groupname    342 Feb 17 11:13 .Xauthority
drwxr-xr-x  14 username groupname    512 Feb 17 11:17 .dt/
-rwxr-xr-x   1 username groupname   5111 Oct  8 14:46 .dtprofile*
drwx------   5 username groupname    512 Oct 19 19:15 .netscape/
drwxrwx--x   2 username groupname    512 Feb 21 14:07 WWW/
-rw-r--r--   1 username groupname    197 Feb  8 14:42 report
2 (leviathan) /ugrads/username>

The Prompt

Before you type the command you see the prompt. The first number is the number of the command (in this example it is the first). leviathan is the name of the server. /ugrads/username is the name of the current directory (where username will be your user name). The last character in the prompt is the greater than symbol. At the prompt you type UNIX commands.

Files

Files have represent more in the UNIX environment then they do in some other operating systems. For example, files are used to represent input and output devices such as the keyboard, mouse and printer. Files can also be links to other files. We will be concerned mainly with normal files and directories. If you look closely at the output from the ls command, each file has a 10-character string of letters and dashes. The first letter in this string specifies the type of file. The most common characters here are - for a plain file, d for directory, and l for a link to another file.

Directories

Directories are a special kind of file that are used to hold other files. This is analogous to a file folder in a filing cabinet. Directories can be nested within each other. Part of the command prompt is the current working directory. In the example, it is /ugrads/username. username is said to be a sub-directory of ugrads. Also worth noting are two special directories that make up the first two entries in the output above: . for the current directory and .. for the parent directory. In other words, .. and /ugrads are the same thing. Every directory listed ends with a forward slash (/) to remind you that it is a directory and not just an ordinary file.

Permissions

The next 9 characters in the string represent the permissions of the file. These can be thought of as 3 separate entities, each containing 3 characters: First the user's permissions, second the group's permissions, and finally the permissions of everyone else (the world). These three characters represent read, write and execute (in that order). A dash represents that that specific type of access is denied. For the first file listed, we see that the user has read, write and execute permission, but the group only has read and execute permission, while all others (the world) have no permissions. Usually, the user should have full access while everyone else's access should be somewhat restricted. Permission to read means that the file can be opened and looked at. Permission to write access means that the file can be modified. Permission to execute means that the file can be executed, but many files are not designed to be executable and will just generate errors if you try to execute them. Normal files that are world executable have an asterisk (*) after them to remind you of this. Permissions take on a slightly different meaning when you are referring to directories. Read permission means that the conents of the directory can be listed (ls would not have worked if you did not have this). Write permission means that you can add files to the directory or delete files from the directory. Finally, execute permission means that you can switch to that directory.

Octal Numbers

Another common way to represent permissions is with octal numbers. Octal numbers use digits from 0 to 7, as opposed to the decimal 0 to 9. Each group of permissions has 3 characters that can take on one of two states (on and off). All permissions off is represented by 0 and all permissions on is represented by 7. You can think of each type of permission having a different wieght: 4 for read, 2 for write, and 1 for execute. If you add up the permissions that are on, you get the octal representation. For example, read and execute permissions could be represented by 5. Recall that there are 3 entities of permissions (user, group, and world). The entire 9-character string can be represented by 3 octal digits. 000 would mean no permissions and 777 would mean all permissions. If you look at the first file in the example above, its permissions could be represented by 750.

University Home
©2006 Disclaimer

Write us at: 4 East Alumni Ave, Kingston, RI 02881-0805, USA.
Phone: 401-874-2505, Fax: 401-782-6422.
Contact the department. Javascript menu by Milonic.

Page last updated: Monday, April 24, 2000