On “rcs” and related commands
The “rcs” package is a bunch of commands to be used at the terminal (or in an xterm window). I find them useful, and perhaps you will, too, particularly if you sometimes work at the command line. The rcs commands are used for tracking different versions of a text file or of a collection of files.
This will be an introduction, describing what they do. In a future post, I will go through the details of how to use these commands. And, following that, I may provide an additional post on how I use them to keep track of my own modifications to system configuration settings.
The rcs software is an example of revision control software. It is primarily for text files, such as program source code. It allows you to easily keep track of multiple versions of a file (of a source program, for example). The name “rcs” stands for “Revision Control System.”
You have a neat little program that you are using. You decide to make it better. Unfortunately, the new improved version doesn’t work. If you have been consistently using rcs, then you can easily go back to the previous version.
As you are changing your file, you can check in the changes. For this, you would use the “ci” command. You check in the latest version, and the software tracks the changes.
The rcs suite keeps track of the versions quite efficiently. The version file contains the latest version. It also contains the difference between the latest version and the previous version. And it has the difference between the previous version and the version before that. If you need to revert to an earlier version, the software applies those differences to reconstruct the earlier version.
The main commands are:
- ci – to check in the current version of a file;
- co – to check out a specific version;
- rcs – to set various options for the archive;
- rcsdiff – to list the differences between two versions;
- rlog – to provide a summary of the versions available;
- ident – to pick out the rcs identification lines of files (if present).
Of those, “ci” and “co” will be the two most used.
How I use rcs
In practice, I keep an rcs archive of program source code, of shell scripts, of latex source files, of configuration files, of the homework assignments that I assign, of grade lists, etc.
When I install opensuse, the rcs suite is not part of a standard install. It is present on the install DVD, so I usually include when installing from the DVD image. If I install from a live CD image, then rcs is one of the first packages that I will install from the repos after I have my system up and running.