CDF is based on the Unix operating system, and consists of a network of workstations, together with several servers providing file storage and additional computing power. The Department of Computer Science is grateful to both the University’s administration and various donors for their generosity in suporting computing education.
Announcements are also made to the news group ut.cdf.announce, and as you login to the cdf computers on campus, remember to read the message of the day.
You will be expected to use the command line more often after first year, but you should find what you learnt from First Year or New Users guide useful. A small amount of the information in the first year guide is repeated (for example the location of labs).
Because of this background, this guide covers
If you have a technical problem that you can’t resolve by reading manual pages or asking informally for advice, you may ask the sysadmins, by e-mail to "admin@cdf.toronto.edu". But before you send your question, try CDF FAQ (or type faq on the command line ) and the CDF home page.
BA2210, BA2220, BA2240, BA2270, BA3175, BA3185, BA3195 and the Great Hall with between 12 to 24 machines each.
You are sharing these resources with other students, so please read the sections on Good Citizenship and How to Share.
An important point for those used to using a personal or single user computer is:
The University asks us to publicize this warning:
Any attempt to interfere with the operation of a computing system or with the work of a fellow-student may be looked upon as a serious breach of academic discipline. Such activities as interfering with others’ files, changing their passwords or copying their programs could lead to an appearance before the University Tribunal and to a punishment ranging from 0 in the course to expulsion from the University.
Among other things, you should realize that copying programs, like copying essays, is a form of plagiarism.
It is also worth mentioning that your computing account has been given to you for use solely by you. Its use by others or for other than the intended purposes—for example, course work in courses not supported by CDF, or work related to your employment—may result in its suspension or cancellation.
Sometimes it may be a little unclear which set of rules is relevant, but it is very clear that some set of rules will apply to an offence on CDF. And the University considers that it has jurisdiction even if the misbehaviour actually took place at a distant site and CDF was involved only by providing network access.
Accounts are prefixed by ‘c#’, where # corresponds to the last digit of the year you get your account (eg 5 for 2005) and then the first six letters of your last name, as it appears on your student card. If the first six characters are shared by more than one person, accounts created later will have the last character shifted farther down in the alphabet: clarke, clarkf, … , clarkh.
If your last name is shorter than 6 letters, letters from your first name on your student card will be used to fill.
| Name | Account/Login |
| CLARKE JAMES | c5clarke |
| CLARKE THOMAS | c5clarkf |
| LI JENNIFER | c5lijenn |
When your account is created, you will be sent email (to the address you supplied in ROSI) with the details. If you forget your account name, please use CDF Username Lookup.
Your password will initially be your student number, but you must change it the first time you log in. Too many people know your name and number for the password to be left unchanged. It is important to choose a secure password, since your account will be around for a long time.
Your account will be used for all your St George campus CSC courses that use CDF for the remainder of your time at the University, as long as you continue to take at least one such course per academic year. However the account will only be active during the time you are enrolled in a course; when the course ends the account will be suspended. Your files, password and any personalization of the account will remain preserved until the next time you take a course, at which time the account will be reactivated. Note however that if an entire academic year passes without a course being taken the account will be deleted.
A social advantage of a program account is that it gives you a kind of identity that we hope will make you feel more at home at CDF. Besides its continuous availability, your account has a name of your choosing. g1joe might be Joe Clarke’s account name. Here the "g" indicates the St. George campus and the "1" is the last digit of the year in which the account was set up. The remaining characters were Joe’s choice.
In return we expect program account holders to accept some responsibility. You should be a little more aware of correct computing behaviour, and more willing to help less experienced users. During terms when you are not taking any courses on CDF, you should log in regularly to check your mail and make sure that your files are as you left them and that there are no signs of intrusion into your account. (If you expect not to be using CDF for a long while or over the summer ask the system administrators to suspend your account whilst you are away. And it would be nice of you, if you are not enrolled currently in any CDF courses, to try to avoid occupying a workstation when CDF is very busy. The primary purpose of the system, after all, is to support active course work.
Program accounts are set up at the start of the next term after you have requested the account. You can request a program account online
If you are not in a Major or Specialist undergraduate CSC program in the Faculty of Arts and Science on the St. George campus, then we cannot arrange a program account for you. Accounts are not offered to students in the Minor program, to students in Engineering, or at UT Mississauga or UT Scarborough, all of which offer their own computing support to their students.
The first time you log in to CDF, you must change your password.
You will be asked to read the CDF Rules, and then to change your password. You have to enter your old password, and then the new one twice, to make sure you're typing it consistently.
Your new password will only be accepted if it passes a program designed to crack passwords. If it does not, you will be asked to enter another one. Good password rules require a mixture of upper- and lower-case letters (from the usual European alphabet), numbers and punctuation (but no spaces). It must be between 7-8 characters in length. The idea is to make it harder for an attacker to guess your password: "hiMom!" or "TrustNo1" are harder to generate automatically than "mymother" and "TRUSTME".
On the other hand, you need to be able to remember your password. Pick something that's not totally random, such as a phone number combined with a name ("978-Fido") or a derivative of a memorable phrase (eg. Wylfwt? ~W Would you like fries with that?). Choose your password before going to CDF to change it, so you'll have a clearer idea of whether you really can remember it.
Change your password during the term.
The easiest way to change your password is to type
at the command line. You will also find Reset Password in the menu.
Forgot your password?
We can't tell you what it was. Show your photo ID card to a system administrator in their office in BA3224 to have it reset to your student number. You must then reset it to what you want.
There are numerous ways to end your login session, (switching the machine off is not one of them), whichever method you choose, you should see the machine return to the login prompt. You can then leave.
Three resources are important enough that sharing may need to be enforced: file space, printer output, and the workstations themselves.
If you exceed this quota or "soft limit" you are notified during login, and you should remove as many files as you can. Obvious candidates for deletion are "core" files from program failures, debugging output listings, executable files, and your own backup copies. You should also consider moving files onto other media for backup.
If you exceed the "hard limit"—about 10% more than the soft limit—or if you have been over the soft limit for too long, you can no longer write files to disk. You can fix this only by deleting files. If you exceed the hard limit while editing, you will be unable to save the work you’re doing in your own home directory. Instead, save it in the "temporary" directory /tmp, giving it a name like /tmp/c1abcdef if c1abcdef is your login id. Then delete unnecessary files and copy the temporary file to your home directory. You have to do this promptly, because files in /tmp are destroyed irrevocably once or twice a day.
The error message you’ll see when your hard limit is exceeded is "No space left on device." This is wrong—it’s not the whole device that’s full—but the wrong error message is Unix’s fault, not ours, so we can’t fix it.
You also have a disk quota for your mail INBOX. The quota is 2 megabytes, with a hard limit of 5 megabytes. If you go over the 5 megabyte quota, mail can no longer be delivered. Remember to move your received mail from the INBOX to another folder, as the other mail folders are stored in your home directory, whereas the INBOX is stored on a separate system (with the low quota).
The command quota -v will tell you how much disk space you’re using. It reports your usage of your home directory and your mail INBOX. You will probably find you are nearly always well below your limits, which are intended to prevent the few irresponsible users from completely filling the disk, as could sometimes happen.
This print limit is not so stringent as it sounds, because you can print more than one "page" of output on one physical side of a piece of paper. The command print can help you use your quota efficiently in this way. Read about it with "man print".
You should print only what you really need to print in order to keep within your quota; almost all students do manage to finish their coursework in this way. However, if you reach your limit with printing still left to do, visit the system administrators in BA3224 to pay the fee for further output. The fee is not enormous, but you can keep from paying it if you print conservatively.
Without limiting your working time, CDF already limits the length of time you can leave a workstation idle. A "daemon" regularly inspects workstations that have users logged in, and logs off those showing no activity for a period between ten minutes (when the labs are busy) to an hour. This means a student cannot lock the workstation to reserve it.
The interface you see when you log in might look very much like a MS Windows session. Don’t be fooled, one of the greatest features of Unix is it’s flexibility. What you see is the result of a "window manager". The default one used at CDF is named "KDE" but there are numerous others available, someday you may want to experiment with some others.
KDE provides a menu to launch many programs you will use often, but much of your work at CDF will be done from an "xterm" window using an interface that is very similar to what you’ve probably seen in the MS-DOS window of a Windows-based PC.
The KDE "xterm" can be launched from the console icon on the panel or by typing konsole on the command line. If you want to launch a traditional xterm, type xterm at the command line.
In an xterm window, you are using a line-oriented system, sometimes called a command line interface or CLI. This means that your interaction with the computer proceeds like this: it displays a prompt, you type a command, it displays the output from the command, and then you see the prompt again. At the end of each line of your input, you have to press the Return or Enter key.
If the command you typed launches an additional window the prompt will not return until that window closes. Usually you will put an ‘&’ after the command to indicate you want the child process to proceed independently, eg ‘firefox&’.
You can examine and change them if you wish. If you look in your ".login" file, using a text editor as described in the Introductory Unix section, you’ll see various commands determining the initial appearance of the screen, just after you log in. You can modify these in fairly obvious ways to make the screen more comfortable for you.
Occasionally by accident or misadventure you will mess up your .login, .cshrc, or some other file. When that happens you can give the command
/local/bin/startupfiles
to restore the system default startupfiles.
If you make changes to the appearance of your desktop that you do not like, remove parts of the menu or if you manage to make your KDE unusable, you can run
/local/bin/kdedefaults
to restore the KDE defaults. This will take effect the next time you login.
When you type something like
garble blat
in response to the shell’s prompt, the shell will execute the first file named "garble" it finds, with the argument "blat".
Where does it find the command? You have an "environment variable" called PATH that lists where the shell must look, and the order in which it must look. (An environment variable is a named place with a value, like a string variable in a programming language.) The value of PATH is set in your .cshrc file. You hardly ever need to know the contents of your path variable, but you can view it with the command
echo $PATH
(The "$" is necessary because without it, echo would just display the word "PATH".)
You might need to deal with your search path after all, if for example you know there’s a command "garble" kept in a file "/where/garble", but you keep being told
garble: Command not found.
That probably means the directory "/where" isn’t in your search path. If you just want to execute the command once, the easiest thing is to give the command
/where/garble ...
If your current directory (the working directory) is in fact /where you could give the command
./garble ...
since ‘.’ indicates the current directory.
If you find yourself typing /where/ too often, you might want to edit your .cshrc file and add /where to PATH, and then log in again.
The order in which directories appear in PATH matters. For example, you might modify the version of garble found in /where, but the behaviour of ’garble blat’ never changes. The command
which garble
might help you find that "garble" always executes the version of garble found in /whose, That would be because /whose is before /where in the line defining PATH in your .cshrc.
Note. This is when you might end up with the wrong order in your path, such that you can no longer run the commands that were working before. Read the Restoring Startup Files again.
One last word on this subject, there is a command " test " on the default path, and many students will chose to name one of their first programs "test". Make sure you know which test you are testing.
Regular backups of CDF files are done by the system administrators. These backups are really intended to guard against disk or system failures, but they can sometimes be helpful in case of user errors. Some day, you will make a horrible mistake and delete or seriously damage one or many of your files. You then have two choices: do a lot of typing, or try to find an old "backed up" copy of the files. Send mail to admin@cdf to request a file restoration from backup, indicating the file or directory name and path but be aware the backups will be hours or days old.
| Location | Closest Printer |
| 2nd Floor, Bahen | p2210a and p2210b in BA2210 |
| 3rd Floor, Bahen | p3185a in BA3185 |
| Gerstein Lab | gerstein in room 2360, the Gerstein lab |
Whenever you print something, the pages are counted and your printquota is reduced accordingly. There may be times when you want to cancel a print job. Please read the FAQ about Printing to find out more.
There is a central server that manages larger hard disks containing all users’ home directories. When you log in, your centrally located home directory is made available to your workstation using the local network connections.
Other central servers manage communications with other networks, login sessions for users connected remotely, some heavier computing jobs, and other tasks better handled by a central service.
All these servers have names, sometimes more than one name. Workstations also have names. and you can see the name of the workstation you are using when you login. You will hardly ever need to use these names, however you may sometimes want to send a message of the form "Workstation blah is acting up.".
In some of the labs, the workstations are actually X terminals and if you use them, your session is running on one of the remote compute servers and the output is being displayed where you are. This allows you to access the power of the server, but to make use of good graphical interfaces on the workstation.
At CDF you can also use software to obtain a session on one of the compute servers, most likely the command ssh eg ‘ssh cdf’. Use of a terminal session can give you access to a machine such as a compute server with more memory, faster or more processors, or software that isn’t available on your workstation, due to licensing or some other consideration.
You can read your e-mail on Unix with thunderbird, a Gui interface, or with the original mail command, or with pine or various other alternatives such as emacs. You might want to try various choices before settling on the one you think is best.
Warnings
Privacy
Electronic mail may seem like real postal mail. But it does not carry the same presumption of privacy. Your mail consists of files stored at the university’s expense on computers and disks owned by the university, and university employees can read it if the situation requires it.
Ordinarily we won’t read your mail; we’d rather not intrude if we don’t have to. But if there is reason to suspect you or your friends of an academic offence or misuse of CDF, then we may very well read your mail, and you won’t be warned beforehand.
Message size
Some sites will not accept very large messages. Try to keep your e-mail messages under 1 megabyte.
News
Occasionally your instructor will want to send some information to everyone in the class, or the people running the computer will wish to tell all users about some system improvement or less happy event. If this information can be imparted in a line or two, it may appear as a "logon message" that you see after entering your password and before getting your first prompt.
If it is longer, however, it will be in the on-line news, which you are expected to read regularly. You can read news with thunderbird, pine, or with a web browser. You can also use the command trn, which is harder to learn initially, but offers advanced features you might want if you read many newsgroups. During your first news-reading session, you’ll be led by the hand, but after that, when you know what you’re doing, you won’t be bothered.
Each news article or item belongs to a "newsgroup" covering a particular topic. There are many newsgroups, and you should not try to read them all. You should, however, read the group called "ut.cdf.announce" and the groups belonging to courses you are taking, and you might want to read "ut.cdf.general" too. Course newsgroups are simply named after the course, so CSC999’s group is called "ut.cdf.csc999h", for example.
Courses taught at Erindale and Scarborough may have CDF-based newsgroups, but they are increasingly likely to use groups maintained at their home campuses. Check groups with names beginning "ut.erin" or "ut.scar".
Posting news
You can generally use whatever program you read news with to compose and post a newsgroup message. Remember, however, that everyone can read your news item, even if it’s in a course newsgroup, so think twice before posting. A common rule is that you should wait a couple of hours before posting an article. This gives you time to reconsider or at least tone down your posting. It’s very easy to offend inadvertently, and many newsgroups are full of articles provoked by misunderstandings.
Which to use?
Sometimes it’s hard to know whether to use mail or news. Generally, if you flinch at the thought of typing the list of addressees, and there’s a newsgroup that all of them read, you should use news rather than mail.
Because news is totally public, you may sometimes prefer mail, which is at least a little more private. But remember: the privacy of e-mail is only relative! News is recommended for items that many people might conceivably be interested in, mail for topics that are boring to most people and perhaps somewhat private, and a non-electronic channel for truly private affairs.
In the context of an academic course, you should strongly consider sending queries about assignments to your instructor by mail. Posting too much information regarding an assignment, (particularly a message containing code, algorithms, or methodology involving the solution), in a public forum can lead to severe consequences. You could expect to receive a reply by mail, but the answer to your query might also appear in the course news, since many students are likely to be interested in the answer, once the instructor has edited out any excessively revealing details.
The sections below briefly mention some of the topics handled in Working at Home.
You can access your CDF account by ssh from another machine on the Internet. ssh is a command or protocol you can use on one Internet-connected computer to log in to another Internet-connected computer. CDF is on the Internet, so if you have an account at an Internet service provider at home you can log in to CDF with ssh. Assuming your account name was foobar, you would
To connect to CDF, use
ssh foobar@cdf.utoronto.ca
or
ssh foobar@cdf.toronto.edu
(They’re equivalent.)
This will give you a command line session with the CDF system. The CDF system actually consists of three compute severs, and by accessing them using the name cdf, the load is spread.
Very occasionally during the year, one of the compute servers might be overloaded. You would notice this if cdf did not respond as it usually does. Under that circumstance, you could try going directly to one of the compute servers; the names are werewolf, seawolf and skywolf. In this case, you would
ssh foobar@seawolf.cdf.utoronto.ca
Security is a serious concern. Other systems or unix books you have read may have mentioned similar capabilities but called it ‘telnet’. Telnet into CDF has been disabled due to it’s inherent insecurity, but if you must connect from CDF to some other system that unwisely still allows it, the ‘ telnet ’ command is available.
For example you can copy your files from CDF with the scp ("secure copy") command:
scp user1@machine1:file1 user2@machine2:file2
This copies file1 on machine1 to file2 on machine2. The machine name can be omitted if it is the one you are logged in on, as can the usernames if they are the same on both systems. You can also copy directories; read scp’s manual page for details.
For example, to copy the file "chaos.c" from CDF, where we suppose you are logged in, to the account foobar on the Scarborough computer "bluffs.scar", you would give the command:
scp chaos.c foobar@bluffs.scar:chaos.c
The original file is not altered in any way. You can then log in to bluffs.scar and work on the new copy there. If you want to ship the new version back to CDF, you say (on bluffs.scar):
scp chaos.c g2foobar@cdf:
Notice that the file name on CDF is omitted, because it’s the same as the name on bluffs.scar; we could have done that the first time. The original version of the file on CDF is now replaced with the new one.
To copy files between systems without being prompted for a password you might have a file called ".shosts" on the "other" machine—the one you are not logged in on. This file contains the name of the account where you are logged in, in the form "user@machine".
Another possibility is simply to bring a diskette to campus and use a workstation’s floppy drive. There is a set of commands allowing you to transfer files between the MS-DOS floppy disk and the Unix hard disk. Read "man floppy" for more information. On some workstations to eject your floppy you will need to use the command "eject".
If you are moving a file by putting your floppy into the disk drive attached to a CDF workstation, you can avoid end-of-line problems completely by using the -t option of the mcopy command. It’s in the manual page.
You can also convert a file from one end-of-line convention to another with the flip command:
flip -u
changes from MS-DOS ends-of-line to Unix, and
flip -m
changes from Unix to MS-DOS.
Interrupt (initially control-C): The interrupt character allows you to stop a running program.
Erase (initially the "Back Space" key): The erase character removes the last character you typed on the command line, and usually does the same thing in text editors and other contexts requiring you to type responses.
Kill (control-U): erases all characters back to the beginning of the line.
End-of-file (control-D): can be used to mean "end of input" to a program, or "logout" when that is appropriate.
The allocations of keys to these roles can be changed. For example, many people like to set the interrupt character to be the "Delete" key instead of control-C. Figure out how to do this later on, if you like.
The internal nodes of the tree contain only pointers to other nodes. These internal nodes are called directories, and as in any tree, directories can contain pointers to other directories.
The drawing below is a representation of this structure, always drawn with the root at the top.
/ Root directory ( always / )
|
----------------------
| | | |
/bin /etc /local /h
|
----------
| |
u1 u2
|
-----------------
| |
c3studen c3anothe
|
-----------------------------------
| |
a1 a2
| |
------------- ----------------
| | | |
First.java Second.java mywhere.c a.out
Here we imagine that you have a course account and your account name is c3studen. Your "Home" directory is actually the subtree rooted at /h/u1/c3studen. You appear to have two assignments, and in one of them you have two files. Thus, the "leaves" in your tree are First.java and Second.java.
Meanwhile, your friend’s home directory is "c3anothe", and both these directories are children of the directory "u1". Along with other directories, it is a child of the directory "h", and "h" and its other siblings are children of the root directory. In Unix, the root is always called "/"; the slash character is especially significant, as we shall see in a moment.
All the files you can use are in a single tree structure. They may be on different disks, and they may belong to different users, but they are in the same tree.
Every file can be named by specifying the full path from the root to that file. You specify the path by naming every directory on the path, separated by slashes and followed by the name of the file. Here are some examples:
| /h/u1/c3studen/a1/First.java | your first java file |
| /h/u1/c3studen/a2/mywhere.c | your c assignment file |
| /h/u1/c3studen | your home directory |
| / | the root directory |
The name of the root is a special case, but a very natural one.
Every object in the file system is a file. That includes directories, for example: we saw that your home directory has a name, just like your program file. The same rule applies to system commands and other programs.
For example, the file-listing command "ls" is actually a file itself, probably "/bin/ls". Most of the Unix commands are kept within the directories /bin, /usr/bin, /etc, /local/bin and perhaps some others.
When you give a command, Unix looks for a file whose name is the same as the command you give. The command "ls" can be used to list all the files contained in a directory, so you could say
/bin/ls    /h/u1/c3studen
to list all the files in your home directory. In this example, the first file name, "/bin/ls," is used to locate an executable file or program to be run, and the second name is an argument used by the running program. Here the argument says which directory to list.
Obviously it would be a major nuisance to have to specify full pathnames all the time, and in fact you can usually list your files just by saying
ls
How is such an abbreviation possible?
1. The system maintains a list of paths to search for commands that you give. Almost certainly, "/bin" would be one of these standard paths. When you give the command "ls", it would be found on this path.
2. You have a location in the file-structure tree, and commands often assume by default that you’re referring to your current location. Your location is called your "working directory" or "current directory"; when you log in, your current directory is your home directory. You can change your location with the "cd" command.
If you don’t specify another directory, "ls" lists the files in the working directory. This rule and the previous one together are enough to abbreviate the file-listing command we’ve been using as an example.
But other abbreviating rules are also available:
3. You can specify a file by its path relative to the working directory instead of the root. For example, to list the files in your "a1" directory, you could say
ls    a1
instead of
ls    /h/u1/c3studen/a1
assuming that /h/u1/c3studen is your working directory.
4. Some filenames have standard abbreviations:
. (just a dot) is the working directory.
.. (two dots) is the parent of the working directory.
~c3anothe is the home directory of the user whose account name follows the tilde (~).
~ is your own home directory.
$HOME is another name for your home directory.
We’re omitting some details here—specifically, the question of what part of Unix provides these abbreviations. Later, you may well want to know about that.
These are a few that you need most:
man command
tells you about the command. Man displays the standard description of the command from the Unix manual. This description is often called a "manual page".
You may not need man much after you’re used to Unix, because most commands have a simple "default" behaviour. Often, though, a simple command can become rather complex if you want to use options.
lists just the names of the files in your current working directory. This is usually what you want, and so should be easy to get. But if you’d like the dates the files were last modified, ask for the optional longer listing by adding the flag "l" (the letter L):
ls -l
Options are requested in Unix by flags preceded by a hyphen or minus sign, as in this example. (The example is pronounced "ell ess minus ell".) You can ask for the listing to be sorted by time of modification instead of by name, as well as asking for the longer listing, by adding the "t" option:
ls -l -t
But this would get a little tedious, so you’re usually allowed to combine several option flags after a single hyphen:
ls -lt
As a matter of fact, the ls command has a surprising number of options. Read all about it in the manual page, with "man ls".
You can also copy whole subtrees. See the manual page.
You can move more than one file at once:
mv file1 file2 ... directory
puts all the files into the directory. And
mv * directory
moves all the files into your current directory into the named directory. (If the named directory is in the current directory, then it will be one of the files you are trying to move, and mv will be a little unhappy, because a directory can’t be inside itself, but there will be no damage. Try it.)
The asterisk in the last example means "all files in the current directory." There are several abbreviations of this sort, and they can be used in any command, not just mv. See the next section, "Specifying more than one file."
You can also move whole subtrees. See the manual page.
mv file1 file2
renames "file1" as "file2". If there is already a "file2", it will be deleted.
* means "all the files in the current directory."
*a means "all the files in the current directory whose names end with ‘a’."
*a* specifies files with an ‘a’ somewhere in the name.
At this point, MS-DOS users should be told that Unix cares about case: both the last two examples would include the file "Walla" but not the file "WALLA". In fact, as a Unix user you should begin to expect lower case as the default, and use upper case only when you want to shout.
If you want to match a single character instead of a string, use ‘?’ instead of ‘*’:
?.out
rm *
You can see why this is dangerous!
cat junk splat
If you want to make a new file called "both" that contains the contents of "junk" followed by the contents of "splat", use cat like this:
cat junk splat > both
The character ‘>’ redirects the output of the command: it connects the standard output to a file instead of the monitor.
Similarly, if you wanted to, you could use ‘<’ to connect the standard input to a file:
cat < junk
This particular example is a somewhat unlikely use of redirection, because (like many Unix commands) cat treats a single file argument as if it had been redirected from the standard input. But in other situations, input redirection can be very useful.
There are three kinds of permission:
read permission allows the user to view the contents of a file, use it as input to a program, or, if it is a directory, list the files that are its children.
write permission allows the user to change the contents of the file, overwrite or delete the file, or, if it is a directory, add new child files or delete old ones.
execute permission allows the user to run the file as a program. If the file is a directory, "execute" permission allows you to access its children; of course, the permissions of the child files themselves also control your access
If you have execute permission on a file, then you can treat it exactly as you would any other Unix command. If the file is called "myprog" and was created by compiling a program that expects two arguments, you can call it by saying
after the prompt. The standard Unix commands are files too: look in /usr/bin, /bin, /local/bin and various other directories to find them.
Now that we know the kinds of permission that exist in Unix, we can consider the kinds of users to whom they apply. For any file, there are three classes of user:
owner: the user who created the file, probably. To find out the owner, do
group:
others: everyone else.
So there are nine kinds of permissions for a file: read, write and execute permissions for owner, group and others. These are usually thought of in that order; for example,
rwxr-x---
would be the list of permissions for a file on which the owner has all three permissions (rwx), other group members have read and execute permissions but not write permission (r-x), and everybody else has no permissions (---).
The command "ls -l", as we already mentioned, gives a longer listing of the files in the current directory (or another directory if you specify it). This listing includes the permissions for each file at the left, with an additional tenth character to the left of the permissions that indicates whether the file is a directory (and has some other more esoteric uses as well).
To change file permissions, use this command:
chmod mode filename
Here "mode" describes how you want the permissions changed. The simplest type of "mode" states the people affected and the kind of change to be made, using characters to symbolize the meaning. For example,
chmod g+r filename
adds read permission for the group, while
chmod u-w filename
takes away write permission from the user who owns the file—that is, you yourself—perhaps to prevent accidental removal. For more details, read the manual page for chmod.
pico
nedit
vi
For a helpful introduction to vi, see the directory /u/cssu/pub/doc/vi
where you should start by reading the file "Readme".
emacs
ed
There are lots of files you usually don’t want to be bothered with, including configuration files that determine how your account will behave and command files that are run by specific programs when they start up. Often their names will begin with a period to make them invisible, and commonly they end with "rc" (for "run command"). Some examples:
.login a file describing how your account is to be set up when you log in.
.logout a cleanup file, executed when you log out.
.mailrc used by the mail program.
.newsrc used by many news programs.
You don’t need to know very much about how you interact with the operating system, but it does help to know a little.
The basic fact to understand is that at all times a program is running. That’s right: all the time, even when you’re just sitting there thinking about what to type after the prompt. You may think that at these times you’re dealing directly with the operating system, which you’ve heard manages interactions with users as well as allocating time to various tasks, looking after input and output, maintaining the file system, and so on.
But that’s not true. You deal not with the operating system itself but with a shell, a program that mediates between you and the operating system. When you ask for a listing of your files, your "ls" command is collected by the shell and interpreted to find out that you want to run the "/bin/ls" program. Then the shell asks the operating system to start up "/bin/ls", which lists your files and then asks the operating system to start the shell going again.
This may sound cumbersome, but in fact it’s very handy. We want the operating system to concentrate on its own major concerns without fussing about making things look good to users. That leaves the shell to pay careful attention to things like editing the command line when you type a back space, remembering your working directory, and locating programs you want to execute.
What happens is that the shell program is started up (by the operating system, of course) as soon as the logging-in process is finished. When it starts up, it reads the file ".cshrc", containing customizing commands. Consequently, you can modify the behaviour of the shell by changing the contents of .cshrc. For example, you can change the characters used for interrupt and backspace, you can set up aliases—short commands that you use in place of long, tedious ones—and so on.
Every time you open a new window, a separate copy of your shell is set up to control it, and it begins by executing the commands in your .cshrc file. (This is different from your .login file, which is run only once, when you log in.)
There’s a lot you can put in your .cshrc, too much to cover here. The default shell we have chosen to set up your CDF account with is csh or the "C shell," after the programming language C. In fact, rather than the standard C shell csh, we’ve given you a variant called tcsh, but the differences are minor.
There do exist other shells. The traditional alternative is sh, the "Bourne shell". Sh has its uses, but it is less convenient for stopping and restarting jobs ("job control") and reusing previous commands ("history"), Just like other programs, the various shells have manual pages. Try "man csh", "man sh", or "man tcsh" to find out more, probably, than you can easily absorb about your shell.
Almost all Unix programmers prefer to use the Bourne shell, sh, for their shell scripts, rather than the C shell.
The particular windowing system used at CDF is "X Window", sometimes called just "X". Other windowing systems are available for Unix, but X is the one used here.
Windows
Mice
In X Window, to work in a particular window you simply position the mouse pointer in that window. You don’t have to click any of the mouse buttons, but you do have to keep the pointer in the appropriate window. This is different from MS Windows, and it may take you a while to get used to it. When the mouse pointer is in a window, the background to the window’s title bar and the window’s borders change appearance to indicate the window has the focus.
Using the mouse
Here are some useful mouse operations: Click in a window’s title bar: Even if a window is currently active, because the mouse pointer is on it, it may still be partly covered by other windows. To "raise" the window so that it is completely visible, click in the window (sometimes you have to click in title bar) with the left-hand mouse button. To "lower" it—put it under the other windows—click on the title bar with the middle mouse button.Click and hold: Holding a mouse button down often displays a pop-up menu.
Sometimes you may need to press a key on the keyboard at the same time as you press a mouse button. For example, as discussed below, you can customize a terminal window by holding the "Control" key down while pressing a mouse button.
On the background (sometimes called the "root window"), holding down the right mouse button brings up a menu of interesting choices.
In the title bar, holding down the right button, or clicking on the window menu button in the top left corner, gets you a menu giving various options for changing the window’s appearance, such as resizing, moving, raising and lowering. Some options, like resizing and moving, start an operation that continues until you click a mouse button.
Within a xterm window, when the Control key is pressed on the keyboard, all three mouse buttons give you menus affecting the appearance of the "terminal." For example, you can obtain a scroll bar that allows you to look back through previous output to the screen, using the mouse buttons to click and drag in the scroll bar; you can change the size of the type in the window, and so on.
The minimize button at the right end of a window’s title bar shrinks the window. The window still exists, and if it is a terminal session, still contains the output from any running program. This is like the "minimize" button in MS Windows. The maximize button, next to the minimize button, allows you to increase the size of the window. You can also use the "maximize" option from the right-hand mouse button’s title-bar menu.
In order for this arrangement to work in a fair and friendly way, all users have certain responsibilities. You must try not to use more than your share of time, space and paper. You must set up your account so that illicit users would find it difficult to break in, and you must be attentive to what is happening so that misbehaviour by others will be detected before serious damage occurs, either to the physical machinery or to the files and software. You must not eat or drink in the workstation rooms, nor litter. Please clean up papers or debris left at the workstations by less conscientious users.
You may think it unreasonable to ask students to take responsibility for a university-owned system like CDF. But it is impossible to station official watchers in every room or to chain down all removables; and you wouldn’t like it anyway if we could do that.
We do not ask you to be a police officer. We ask only that you behave like an older sister or brother. Assert your own rights, but don’t over-assert them. Be conscious of others’ needs and help to educate the less mature users: most misbehaviour by users is caused by ignorance, not malice.