# info > rcs

---
type: CommandReference
command: rcs
mode: info
section: "1"
source: info
---

## Quick Reference

- `ci file` — Check in file (store as revision 1.1, delete working file)
- `co file` — Check out latest revision (read-only)
- `co -l file` — Check out and lock for editing
- `rcsdiff file` — Compare working file with latest revision
- `ci -l file` — Check in then lock (implicit checkout)
- `ci -r2 file` — Check in as revision 2.1
- `co -r2 file` — Check out latest on branch 2
- `ci -r1.3.1 file` — Start a branch at revision 1.3

## Name

GNU RCS — Revision Control System: manages multiple revisions of files, stores, retrieves, logs, identifies, and merges revisions.

## Synopsis

shell
rcs command [options] file ...
Available commands: `ci`, `co`, `ident`, `merge`, `rcs`, `rcsclean`, `rcsdiff`, `rcsmerge`, `rlog`.

Options appear before file names. Revision numbers can be specified as `BR.N`, `.N`, `BR`, `NAME`, or `$` (from working file keywords). Date format is flexible (ISO 8601, RFC 822, etc.). Default timezone is UTC unless `-z` is given.

## Options

### Common Options (all commands)

- `--help`, `--version` — Display help or version info.
- `-q` — Quiet mode; suppress warnings and prompts.
- `-I` — Force interactive mode (assume terminal input).
- `-T` — Preserve RCS file modification time when possible.
- `-V` or `-VN` — Display version or emulate RCS version 3/4/5.
- `-wLOGIN` — Specify author (default from `LOGNAME`/`USER`).
- `-xSUFF` — Set RCS file suffix list (default `,v/`).
- `-zZONE` — Set timezone (e.g., `LT` for local time).

### Options for `ci` (checkin)

- `-f[REV]` — Force new entry even if unchanged.
- `-i[REV]` — Initial checkin; error if RCS file exists.
- `-j[REV]` — Just checkin, don't initialize; error if RCS file missing.
- `-k[REV]` — Compute revision from working file keywords.
- `-r[REV]` — Normal checkin (default).
- `-l[REV]` — Checkin then lock (implicit checkout).
- `-u[REV]` — Checkin then unlock (implicit checkout).
- `-M[REV]` — Set working file mtime to revision date.
- `-d[DATE]` — Use given date (default: working file mtime).
- `-m[MSG]` — Log message (default: `*** empty log message ***`).
- `-nNAME`, `-NNAME` — Assign symbolic name (new or overwrite).
- `-sSTATE` — Set state (e.g., `Exp`, `Rel`, `Prod`).
- `-t-TEXT` or `-tFILE` — Set description text.
- `-wWHO` — Author login.

### Options for `co` (checkout)

- `-f[REV]` — Force overwrite of working file.
- `-p[REV]` — Write to stdout.
- `-r[REV]` — Normal checkout.
- `-l[REV]` — Checkout and lock.
- `-u[REV]` — Checkout and unlock.
- `-S` — Self-same mode: prevent double locking.
- `-M[REV]` — Set working file mtime to revision date.
- `-kSUBST` — Keyword substitution mode.
- `-dDATE` — Select latest revision before or on date.
- `-jJOINS` — Merge using join pairs (obsolete; use `rcsmerge`).
- `-sSTATE` — Select matching state.
- `-wWHO` — Select matching author.

### Options for `rcs` (frob mode)

- `-i` — Initialize new RCS file.
- `-L` — Enable strict locking.
- `-U` — Disable strict locking.
- `-aLOGINS` — Append logins to access list.
- `-e[LOGINS]` — Erase logins from access list.
- `-AFILE` — Append access list from another file.
- `-b[REV]` — Set default branch.
- `-l[REV]`, `-u[REV]` — Lock/unlock revision.
- `-cSTRING` — Set comment leader (obsolete).
- `-kSUBST` — Set substitution mode.
- `-mREV:MSG` — Replace log message.
- `-nNAME[:REV]` — Assign symbolic name (delete if no REV).
- `-NNAME[:REV]` — Like `-n` but overwrite.
- `-oRANGE` — Delete revisions (outdate). Range: `REV`, `BR`, `REV1:REV2`, `:REV`, `REV:`.
- `-sSTATE[:REV]` — Set state.
- `-t-TEXT` or `-tFILE` — Replace description.

### Options for `rcsdiff` (diff revisions)

- `-rREV` (up to two) — Compare revisions (default: compare working file with latest).
- `-kSUBST` — Substitution mode.
- `-q` — Quiet mode.
- Other options (e.g., `-c`, `-u`, `-w`) are passed to diff.

### Options for `rcsmerge` (merge into working file)

- `-A`, `-E`, `-e` — Passed to diff3 (`-E` default).
- `-p[REV]` — Write to stdout.
- `-q[REV]` — Quiet mode.
- `-rREV` (one or two) — Specify revisions.
- `-kSUBST` — Substitution mode.

### Options for `rlog` (display log info)

- `-L` — Only files with locks.
- `-R` — Print only RCS file name.
- `-h` — Header only.
- `-t` — Header + description.
- `-N` — Omit symbolic names.
- `-b` — Select default branch.
- `-dDATES` — Select revisions by date range.
- `-l[WHO]` — Locked by WHO (any if omitted).
- `-r[REVS]` — Select revisions by range.
- `-sSTATE,...` — Select by state(s).
- `-w[WHO]` — Selected by author.

### Options for `ident` (scan keywords)

- `-q` — Suppress warnings if no keywords found.

### Options for `merge` (3-way file merge)

- `-A`, `-E`, `-e` — diff3 style.
- `-p` — Write to stdout.
- `-q` — Quiet.
- `-L LABEL` (up to 3) — Conflict labels.

### Options for `rcsclean` (clean working files)

- `-r[REV]` — Specify revision.
- `-u[REV]` — Unlock if no differences.
- `-n[REV]` — Dry run.
- `-q[REV]` — Quiet.
- `-kSUBST` — Substitution mode.
- `-T` — Preserve RCS mtime.

### Keyword Substitution Modes (`-kSUBST`)

- `kv` — Default: `$Keyword: value $`
- `kvl` — Like `kv` but always include locker.
- `k` — Only `$Keyword$`
- `o` — Old value from working file.
- `b` — Like `o` but binary mode.
- `v` — Only value (dangerous, disables further substitution).

### Environment Variables

- `RCSINIT` — Space-separated options prepended to command line.
- `RCS_MEM_LIMIT` — Memory limit in KB (unlimited by default).
- `TMPDIR`, `TMP`, `TEMP` — Temporary directory.
- `LOGNAME`, `USER` — Used to determine author.

## Examples

shell
# Initialize repository
mkdir RCS
ci f.c                           # Creates RCS/f.c,v, revision 1.1, deletes f.c

# Checkout and edit
co -l f.c                        # Checkout latest, lock for editing

# Compare working file with latest revision
rcsdiff f.c

# Check in with lock (continue editing)
ci -l f.c

# Check in as new release
ci -r2 f.c                       # Creates revision 2.1

# Start a branch
ci -r1.3.1 f.c                   # Branch at 1.3, creates 1.3.1.1

# Disable strict locking
rcs -U f.c

# View log
rlog f.c

# Merge two revisions into working file
rcsmerge -r1.1 -r1.2 f.c

# Extract keywords from binary
ident program.o
## See Also

- [ci](ci) — Check in revisions
- [co](co) — Check out revisions
- [ident](ident) — Display keywords in files
- [merge](merge) — Three-way file merge
- [rcs](rcs) — RCS file administration
- [rcsclean](rcsclean) — Remove unmodified working files
- [rcsdiff](rcsdiff) — Compare RCS revisions
- [rcsmerge](rcsmerge) — Merge RCS revisions into working file
- [rlog](rlog) — Display RCS log information
- [diff(1)](https://man.openbsd.org/diff) — Compare files line by line
- [diff3(1)](https://man.openbsd.org/diff3) — Three-way diff
- [rcsfile(5)](https://man.openbsd.org/rcsfile) — RCS file format
