CAT(1plan9)
π NAME π
cat, read, nobs β catenate files. Yeah bestie, it's the file-gluing trio. π«Ά
β¨ SYNOPSIS β¨
cat [ file ... ]
read [ -m ] [ -n nline ] [ file ... ]
nobs [ file ... ]
πΈ DESCRIPTION πΈ
cat reads each file in sequence and writes it straight to the standard output. So like:
cat file
prints a file, and
cat file1 file2 >file3
concatenates the first two files and drops the result into the third. Iconic behaviour, no notes. π
If you give it no file at all, cat reads from the standard input. Output is buffered in blocks matching the input β so it's not doing anything extra, it just moves the data.
read copies to standard output exactly one line from the named file, defaulting to standard input. It's the moment for interactive rc(1) scripts, fr fr.
-mβ makes it keep reading and writing multiple lines until end of file-nβ makes it read no more thannlinelines
read always executes a single write for each line of input, which is lowkey the whole point when you're prepping input for programs that expect line-at-a-time data. And it never reads any more data from the input than it prints to the output. Respectful king. π
nobs copies the named files to standard output, except it removes all backspace characters and the characters that precede them. It's the move when you want to use it as $PAGER with the Unix version of man(1) while running inside a win window β see acme(1). π¦
π SOURCE π
/src/cmd/cat.c/src/cmd/read.c/bin/nobs
π SEE ALSO π
π₯ DIAGNOSTICS π₯
read exits with status eof on end of file β or, in the -n case, if it doesn't read nlines lines. Yes, the exit status is literally the string eof. Periodt. π
π BUGS π
Beware of<and>which destroy input files before reading them. Like, the shell will absolutely clobber your file beforecateven gets a chance to look at it. Be so careful with this one, bestie, it's giving data loss. π
okay that's the whole page, mwah π
This was CAT(1plan9) from the Plan 9 manual, section 1 β cat, read, nobs, catenating files since forever, and the footer's just CAT(1plan9) right back at ya. πβ¨
π¦ where this page comes from
- debian bookworm: 9base 1:6-13 Β· Lucent
- debian trixie: 9base 1:6-14 Β· Lucent
- ubuntu jammy: 9base 1:6-11 Β· Lucent
- ubuntu noble: 9base 1:6-14 Β· Lucent
- ubuntu questing: 9base 1:6-15
- ubuntu resolute: 9base 1:6-15build1 Β· Lucent
- ubuntu stonking: 9base 1:6-15build1 Β· Lucent
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms