tail

This command displays the end of a datagrid file.

Syntax

zos tail [--retry] [--bytes=] [--follow] [--by-name] [--follow-retry] [--lines=] [--max-unchanged=] [--jobid=] [--sleep-interval=] [--refresh=] [--count=] [--timeout=] [--quiet] path

Arguments

path

The path on the datagrid.

Options

-r, --retry

Continues trying to open the file if it is not yet accessible.

-c=, --bytes=

Generate file output of the specified number of bytes only. The user must enter a value with this option.

-f, --follow

Follow the file, watching for newly appended data.

-N, --by-name

If following a file, periodically reopen the file.

-F, --follow-retry

The same as --follow --by-name --retry

-n=, --lines=

Generate file output of the specified number of lines only. The user must enter a value with this option.

-U=, max-unchanged=

The number of size checks between reopening a followed file (used with --by-name only). The user must enter a value with this option.

-J=, jobid=

If following a file, follow until the specified job terminates. The user must enter a value with this option.

-s=, --sleep-interval=

The frequency of file size checks in seconds when following a file. The user must enter a value with this option.

-R=, refresh=

Server connection refresh rate. The user must enter a value with this option.

-X=, --count=

Maximum number of lines/bytes to display.

-t=, --timeout=

The maximum number of seconds to follow a file.

-q, --quiet

Suppress all warning and informational messages.

-C=, --cols=

Specifies the terminal width for formatting. The user must enter a value with this option.

-h, --help

Displays a help message for this operation.

-d, --debug

Turns on debug output during this operation.

-v, --verbose

Turns on verbose output during this operation.

-z=, --tls=

Force TLS/SSL encryption [on|off]. The user must enter a value with this option.

-Z=, --tlsPort=

Port number for TLS/SSL connections. The user must enter a value with this option.

-y, --tlsYesNew

Force acceptance of new TLS server certificates.

-Y, --tlsYesAll

Force acceptance of all TLS server certificates.

Examples

Example 1

To display the last 5 lines of grid:///!benchmark.jdl, use the following command:

zos tail -n 5 grid:///!benchmark/benchmark.jdl

Example 2

To display the last 5 lines of grid:///!benchmark.jdl in an alternative way, use the following command:

zos tail -5 grid:///!benchmark/benchmark.jdl

Example 3

To continually watch the job log of the latest job, use the following command:

zos tail --follow --by-name --retry grid:///!/lastjob/job.log

Example 4

To watch the job log of job myname.myjob.123 while it runs, use the following command:

zos tail -F -J myname.myjob.123 grid:///^myname.myjob.123/job.log