The command "cat" opens files whose names are given as arguments, and places their contents on standard output. If no arguments are given, standard input will be used instead.
By default, cat reads data forks of files whose names are specified on the command line. However, the resource fork of a file will be read if its name is preceded by the flag "-r".
The command line may be constructed with many file names and many instances of the flag "-r". The appropriate forks of the named files will be read in turn, and their contents placed on the output.
Standard input will be read by default if no file names are found on the command line. To force the standard input to be read anyway, even if the command line does contain file names, the special marker "-" may be used.
EXAMPLES
In the following example both forks of the file "file1" are read (data fork first) and placed on the output:
cat file1 -r file1
This example shows how the output of grep may be framed by the contents of two files: the data fork of file1 and the resource fork of file3: