CAT/TYPE/HEAD/TAIL User Commands
NAME
cat - displays file content.
ALIASES
CAT, TYPE, HEAD, TAIL
SYNOPSIS
cat [OPTIONS]... FILESPEC [FILESPEC]...
type [OPTIONS]... FILESPEC [FILESPEC]...
head NUM [OPTIONS]... FILESPEC [FILESPEC]...
tail NUM [OPTIONS]... FILESPEC [FILESPEC]...
DESCRIPTION
Displays the content of FILESPEC to the standard output.
-D
The file content is dumped in standard hex debug format.
-H NUM
Displays at most NUM lines from the Head of the output.
-T NUM
Displays the last NUM lines or Tail of the output. Note that Tail
is applied before Head and therefore the two may be used to display
a range of lines within the output stream.
-R
Reverse the order of displayed lines. The Tail becomes the Head.
-J
Attempts to display a JSON file in a more readable form.
-P
Displays the last page (23 lines) of the file.
Commands and options are not case-sensitive. Options may appear anywhere
on the command line and in any order. Options may be combined following
the dash '-' or separately specified.
EXAMPLES
cat jniorsys.log -p
Displays the most recent page of SYSLOG entries.
type -j manifest.json
Formats and displays the MANIFEST command reference point database.
cat jniorsys.log.bak jniorsys.log -t 10
Displays the last 10 lines of the system log even if the log has
recently aged to the BAK file.
NOTES
This command will accept piped data if any from a prior command and append
to that each specified file. A file specification is not required if piped
data is available.
New with JANOS v2.4 the file specification may contain wildcards. The matching
files are concatenated from oldest to latest modification date. For instance
the third example above, combining the LOG files, could be executed as follows:
cat jniorsys.log* -t 10
Also new is the ability allowing the CAT command to utilize virtual folders
created by ZIP/JAR library files. This unique feature has been utilized by the
JANOS Web Server to serve entire websites with all of the files required from
a single compressed library file as if presented in a folder of the same name.
For example if you are using the
JBakup application to preserve LOG files for
an extended period, the BAK files for logs are combined and stored within a ZIP
file in the /flash/baks folder. The following CAT command would access that
backup and display the oldest 10 lines of the jniorsys log.
cat /flash/baks/jniorsys.log/jniorsys.log.bak -h 10
Here the file /flash/baks/jniorsys.log.zip created by JBakup generates a
virtual folder. The CAT command can then look inside that to access the
jniorsys.log.bak file it contains. This is a very powerful tool allowing
you to search the extended logs by piping to a additional
GREP command.
Assuming that JBakup has processed the current BAK file into the archive,
which it does on the quarter hour, the following command would list every
recorded NTP time synchronization.
cat /flash/baks/jniorsys.log/jniorsys.log.bak jniorsys.log | grep NTP
This feature does require that you specify the absolute file path for the
virtual folder. Relative paths and wildcards are not allowed.
SEE ALSO
HELP Topics:
MANIFEST,
JSON,
ASCII,
JBAKUP,
GREP
[/flash/manpages/manpages.hlp:2392]