Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lc
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The original source file is `COHERENT/romana/relic/d/bin/lc.c` in the archive.

## Manual

The original manual page:
The original manual page, lightly edited and converted to use modern `-man` macros, is in the file `doc/lc.1`.
On a modern Linux system, it may be viewed with `man ./docs/lc.1`. The original, unaltered manual page source is in `doc/lc.orig.troff`.

A scanned manual page may be viewed below:

![lc manual page](./lc_manual.png)

## Differences from original
Expand Down
6 changes: 6 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Man pages for `lc(1)`

The files in this directory contain the man page sources for [lc](https://github.com/gdm85/lc).

* `lc.orig.troff` contains the troff source file for the man page, with no changes from the original.
* `lc.1` contains a refreshed version of the same man page, modernised to use `-mman` macros and lightly edited for clarity and concision. `man ./doc/lc.1` will render this on a modern Linux system.
75 changes: 75 additions & 0 deletions doc/lc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.TH LC 1 "January 2025" "Coherent UNIX" "User Commands"
.SH NAME
lc - list directory contents in columnar format

.SH SYNOPSIS
.B lc
[\fB-1abcdfp\fR] [\fIDIRECTORY\fR]...

.SH DESCRIPTION
.B lc
lists the contents of the specified
.IR DIRECTORY ,
or the current directory if none is provided. It categorizes files by type (e.g. regular files, directories) and displays them in columns for readability.

.SH OPTIONS
.TP
.BR -1
List one file per line, instead of in columns.
.TP
.B -a
List all files, including hidden entries `.' and `..'.
.TP
.B -b
List block-special files only.
.TP
.B -c
List character-special files only.
.TP
.B -d
List directories only.
.TP
.B -f
List regular files only.
.TP
.B -l
List symbolic links only.
.TP
.B -p
List pipe (FIFO) files only.

.SH USAGE
Options can be combined for customized output. For example, to display all files, one per line:
.PP
.RS
.EX
lc \-a1
.EE
.RE

.PP
If no directory is specified,
.B lc
defaults to the current working directory.

.SH EXAMPLES
The following command lists all regular files in the current directory:
.PP
.RS
.EX
lc -f
.EE
.RE

To copy all regular files to a directory called
.B mydir
you can use:
.PP
.RS
.EX
cp `lc -f` mydir
.EE
.RE

.SH SEE ALSO
.BR ls (1)
63 changes: 63 additions & 0 deletions doc/lc.orig.troff
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.TH lc "" "" Command
.PC "List directory's contents in columnar format"
\fBlc [ \-1abcdfp ] [ \fIdirectory ...\fB]\fR
.PP
.HS
.SH Options:
.IC "\fB\-1\fR (one, not el)"
List files one per line instead of in columns
.IC \fB\-a\fR
List all files in directory (including `.' and `..')
.IC \fB\-b\fR
List block-special files only
.IC \fB\-c\fR
List character-special files only
.IC \fB\-d\fR
List directories only
.IC \fB\-f\fR
List regular files only
.IC \fB\-p\fR
List pipe files only
.Pp
Options can be combined.
If no \fIdirectory\fR is specified, the current directory is used.
.HE
.B lc
lists the names of the files in each
.IR directory ,
or the current directory if no
.I directory
is named.
The files are categorized by type (files, directories, and so on)
and listed in columns within each category.
.PP
The following options modify the output.
.RS
.IP \fB\-1\fP 0.3i
List only one file name per line (do not print in columns).
Please note that this is the numeral one, not a lower-case el.
.IP \fB\-a\fP
List all file names, including `.' and `..'.
.IP \fB\-b\fP
List block-special files only.
.IP \fB\-c\fP
List character-special files only.
.IP \fB\-d\fP
List directories only.
.IP \fB\-f\fP
List regular files only.
.IP \fB-p\fP
List pipe files only.
.SH "See Also"
.Xr "commands," commands
.Xr "ls" ls
.SH Notes
.B "lc -lf"
is useful for producing a list of regular files.
For example
.DM
cp \(galc -lf\(ga mydir
.DE
.PP
copies all regular files to directory
.BR mydir .