Little question on "cat"

jerryp at tektronix.UUCP jerryp at tektronix.UUCP
Tue Jun 26 06:09:39 AEST 1984


>  Does anyone know why "cat" doesn't seem to have a flag...
>  to simply list files with an indication of the name of the file
>  preceeding the contents, separated from the data by a special
>  character or a newline or two... ?

It's not documented, but if you give head(1) more than one file to read,
it spits out a filename before each one, this way:

   % head foo.c foo.man
   ==> foo.c <==
     (contents of foo.c)

   ==> foo.man <==
     (contents of foo.man)
   %

Normally, head gives only the first ten lines... but something like
	% head -200 foo.c foo.man
should give a complete listing of any but the longest files.

--Jerry Peek, UNIX Training Instructor, Tektronix, Inc.
US Mail:   MS 76-036, P.O. Box 500, Beaverton, OR 97077
uucp:      {allegra,decvax,hplabs,ihnp4,mit-eddie,ucbvax}!tektronix!jerryp
CSnet:     jerryp at tek
ARPAnet:   jerryp.tek at csnet-relay
Phone:     503/627-1603



More information about the Comp.unix mailing list