Skip to content. | Skip to navigation

Personal tools
Log in
You are here: Home Documents User Reference cdxls

cdxls

List CDX directory contents.

Synopsis

cdxls [-1rRmlfdFS] [file...]

Description

For each operand that names a file, cdxls displays its name as well as any other requested information. For each operand that names a directory, cdxls displays the names of files and directories contained within that directory, as well as any other requested information.

If no operands are given, the contents of the root of CDX is displayed.

Options

The following options may be given in order to finesse the information displayed:

-F
Display a slash (/) immediately after names that are directories.
-R
Recursively list subdirectories encountered.
-S
Sort files by size.
-d
Directories are listed as plain files (not searched recursively).
-f
Output is not sorted.
-l
(The lowercase letter "ell".) List in long format. If the output is to a terminal, a total sum for all the file sizes is output on a line before the long listing.
-m
Stream output format; list files across a single line, separated by commas.
-r
Reverse the order of the sort.
-1
(The numeric digit "one".) Force output to be one entry per line. This is the default when output is not to a terminal.

The -1 and -l options all override each other. The last one specified determines the output format.

Long Format

If the -l option is given, the following information is displayed for each file: whether the entry is a file or directory, the number of bytes in the file if it's a file (just a hyphen for directories), and nothing else at this time. As mentioned above, if the standard output is a terminal, the listing is preceded by a summary line showing the total size of bytes taken by files in the directory.

Examples

The following command lists the contents of the /data directory:

cdxls /data

This command lists detailed information about the contents of the /archive and /data directories:

cdxls -l /archive /data

This command lists detailed information about the /archive and /data directories themselves, not their contents:

cdxls -ld /archive /data

Diagnostics

The cdxls utility exits 0 on success, an a non-zero number if an error occurs.

Environment

The following environment variables affect the operation of cdxls:

CDX_SERVER
The URL to the CDX server. If unset, a reasonable default is used.

History

The cdxls command appeared in release 0.0.0 of the CDX Client Tools package.

Related content
cdxget