Command cat
Write file bytes to standard output.
Synopsis
cat fileOrdinary invocation: foreground child, PID 3; the shell waits. Allowed as a pipe producer. Also supported as a bare pipe consumer in PID 1 or 2.
Parameters
| Parameter | Meaning |
|---|---|
file | Regular MKS2 file, /dev/null, or /dev/console in the standalone form. |
Description
Streams regular files in 256-byte blocks and yields between blocks. Output goes to the LCD console, or to the pipe when CAT is the producer. CAT does not implement a pager; use LESS for reading long text.
cat /dev/null produces immediate end-of-file. Standalone cat /dev/console echoes keyboard input until SU, then D; BK is converted to a newline.
On the right of a pipe, bare cat is a separate consumer process reading the FIFO; it takes no file argument. File checksums are validated on reaching EOF, so earlier data may already have been displayed before an error is discovered.
Examples
cat /mnt/smp1/demo.bas
cat /mnt/smp1/demo.bas | less
cat /dev/null
cat /dev/consoleLimits and side effects
- One file per invocation; no concatenation of multiple filenames. A console source is not allowed in a pipe. Control bytes are interpreted by the console, not displayed as a hex dump.
Status and diagnostics
Success is status 0. Relevant status codes: 1, 3, 4, 6, 8, 9, 14, 15, 18, 21. See the diagnostic reference.
See also
less · cp · pipe · Shell syntax