next up previous contents
Next: Edit Up: Basic File Commands Previous: Basic File Commands   Contents

Type

To type out a file use the cat (short for concatenate) command, e.g.:-
cat myfile
cat can be used to combine (concatenate) files and hence the rather odd name. For example:-
cat f1 f2 $>$ f3
concatenates files f1 and f2 into the file f3. The command more types out a file one screenful at a time e.g.:-
more myfile

The command less is very similar.

The commands head and tail can be used to type the first or last few lines of a file, for example:-

tail -3 myfile
types out the last three lines of myfile.



P.D. Gronbech (IT Staff) 2015-10-02