File related commands The file related commands allow the user to manipulate files on disk (block) devices. A number of these commands work when applied to character devices such as CON: and CENT: as well as with disk files. The COPY, MOVE, TYPE, CAT and CIO commands overlap in their functions and there are a number of ways of doing any one thing. This largely derives from the fact that COPY, MOVE and TYPE internally use CAT and CIO. Each com- mand has its own application for specific functions. Copying, joining, moving files CAT [pathname1] [pathname2] [device1:] [device2:] .... The CAT command copies and joins files and input from character devices.
All of the named files are joined together in the specified order and are copied onto standard output. Often this output will be sent to another file or a character device using redirection. If no filenames or character device names are specified then this command gets input from standard input: in fact an internal call to the CIO command is made. The CAT command copies by obtaining as much memory as possible then using all of this buffer for reading and writing data in large blocks. When copying from a character device CAT terminates the read when it receives an end-of-file char- acter, normally a control-D.
(See the option 6 4 command for details of how to set end of file characters.) Examples: CAT myfile > myfile.new Creates a new file called ‘myfile.new’ and copies the contents of ‘myfile’ to it. The file ‘myfile’ is undisturbed. CAT myfile1 myfile1 sa: myfile2 > myfile.big Creates a new file called ‘myfile.big’ and puts in it two copies of the contents of ‘myfile1’ followed by input from serial channel A and then one copy of the contents of ‘myfile2’. The files ‘myfile1’ and ‘myfile2’ remain undis- turbed. CAT myfile1 Dumps the file out to the screen. Naturally you can specify multiple file names. CAT con:
> myfile Creates a new file called ‘myfile’, and copies everything you type on the keyboard into that file, without displaying it on screen. The key is Enter 1616/OS Commands User Tutorial Manual Page 65