Saving Your Bacon with Linux RCS
Luke Hebert
- 2 minutes read - 238 wordsRCS (Revision Control System) is a lightweight, file-based version control tool that has been part of Unix and Linux systems for decades. It is especially useful for tracking changes to configuration files, scripts, and documents without the overhead of a full VCS like Git. Below is a compact cheat sheet for the most common RCS commands.
Core Commands
| Command | Purpose |
|---|---|
rcs | Initialize a new RCS repository for a file (creates the .v file). |
ci | Check in a file, storing a new revision in the repository. |
co | Check out a file from the repository into the working directory. |
rlog | List the commit log, showing revision numbers, authors, dates, and log messages. |
Typical Workflow
Initialize the repository for a file:
rcs myfile.txtThis creates
RCS/myfile.txt,vto hold revision history.Check in the initial version:
ci -m "Initial import" myfile.txtEdit the file, then check in the updated version:
ci -m "Updated timeout values" myfile.txtCheck out a specific revision when you need to inspect or restore it:
co -r 1.2 myfile.txtReview the full history:
rlog myfile.txt
Tips
- Use
ci -uto check in and immediately unlock the file for further editing. - Use
co -lto lock a file for exclusive editing, preventing others from checking in changes simultaneously. - RCS stores all revisions in a single
.vfile under anRCS/directory, making it easy to back up or migrate.