CVS and Linux Frequently Asked Questions (FAQ)

18-749: Fault-Tolerant Distributed Systems

1. Are any servers available for course use?

The ASL/game cluster is a group of identically configured machines running Linux. In this course, we will use these machines to test your software. You should now all have accounts on all of the machines in the cluster. Your home directories are in AFS. This makes it easy to switch machines.

When you log in to any of these machines, you will get a list of all of the machines in the cluster. Log in to to get the other machine names.

We will be sharing these machines with people in other courses. This means that you should not attempt to reboot the machines or take them off the network.

For support with the machines, send mail to

Use SSH to log into these machines. Use SCP (or AFS) to copy files to and from the machines.

2. How do I connect to the ASL/game machines?

If you are lucky enough to be running Linux or Mac OS X, ssh and scp are already installed, and can be executed from the command line. "man ssh" and "man scp" will explain in detail how these commands work. To connect to chess using ssh you would execute the command:

To copy a file from your machine to chess, use the following command:

If you are using Windows, then you will need to install an SSH client. The standard client which we recommend is PuTTY. PuTTY is an SSH client GUI, and PSCP is a command line SCP utility. If you want a GUI SCP client, try WinSCP.

Alternatively you can install Cygwin, a Linux-like environment for Windows. Cygwin provides command line ssh, scp, cvs, and other standard command line Linux utilities.

3. How can our project team manage our shared code base?

Several revision control systems exist which track every change made to a set of files. This makes it easy to revert to old versions of a file when you break it, and it also facilitates simultaneous development by different people on different (and sometimes the same) files in your code base.

The traditional program used for this purpose, which we recommend and support in this class, is CVS. Another new contender in the field is subversion, which was designed to be a better CVS.

You can learn about CVS, and find answers to most questions, in the CVS Manual.

A command line cvs client is available on the ASL/game machines, and is included on Linux and Mac OS X machines. If you are developing software in Windows, then TortoiseCVS and WinCVS are standard CVS clients. TortoiseCVS integrates CVS operations into the Windows Explorer, while WinCVS provides a standard GUI. If you are using an IDE for software development, then it very likely has CVS support built in.

4. How do I use CVS from the command line?

Here is an example of using the appropriate CVS commands to create, checkout, and add files to a repository:

# initialize the repository
cvs -d ~/cvsroot init

# initial import
mkdir temp
cd temp
cvs -d ~/cvsroot import project project start
cd ..
rmdir temp

# checkout the repository
mkdir fred barney
cd fred
cvs -d ~/cvsroot checkout project
cd project

# add a file
seq 1 10 > fred
cvs add fred
cvs commit

# someone else checks out the repository
cd ../../barney
cvs -d ~/cvsroot checkout project
cd project

# they add a different file
seq 10 -1 1 > barney
cvs add barney
cvs commit

# then they change the first file and examine the difference
seq 20 -1 15 >> fred
cvs diff
cvs commit

# a conflicting change is made in the first file
cd ../../fred/project
seq 20 25 >> fred

# can't commit change without updating first
cvs commit
cvs update
# now examine file to resolve conflict

5. Does CVS support binary files?

Yes, but you must specify the -kb switch when you add the file:

The binary file section in the CVS Manual provides additional details.

6. How do I rollback with CVS?

There are several options:

If you don't care about the repository updates, use "rm <file>; cvs update <file>”

If you want to roll back your local, uncommitted changes without getting updates from the repository, use:

If you committed changes and want to remove them, things get trickier. Use cvs log to get the revision number of the unwanted change. Assume that you want to undo the changes made in version 1.3:

6. What things should I do when using CVS ?

7. What things should I avoid when using CVS?

8. How do I get help on Linux?

If you know the name of the command, use man. For example, for information about ps, type "man ps".

If you don't know the name of the command, but want to search on a keyword, try:

When you're looking at man pages, glance over the SEE ALSO section. Sometimes it will cross-reference a useful command.

If man fails or you need detailed information, try typing "info <command>".

There is some good online documentation at The Linux Documentation Project, and there are numerous books available for purchase. If all else fails, feel free to email the TA's.

9. What Unix utilities are useful in finding out if your program is running correctly?

10. What are some of the basic commands for AFS?

SCS has a decent AFS web site.

Permissions are handled differently on AFS. In general, people will have permission to see your files unless you use the "fs sa" command. "fs la" shows what permissions are currently granted.

In addition, you need to use "fs lq" to see if you are out of space. df doesn't report useful numbers of afs.

If you want to restore a file, look in the "OldFiles" directory in your home directory. It saves a snapshot of all of your files from the last backup. Older backups also exist (contact, though they take some time to restore.

11. What IDEs are available for Java development?

The two big contenders are IBM's Eclipse and Sun's NetBeans. Of course if you were a real hacker you would content yourself with vi or emacs.

Both of these IDEs should:

Charles Fry, Spring 2005
Greg Hartman, Spring 2004