ls

Lists VOB-resident objects, elements loaded into a snapshot view, and view-private objects in a directory

Applicability

Product

Command type

VersionVault

cleartool subcommand

VersionVault Remote Client

rcleartool subcommand

Platform

UNIX®

Linux®

Windows®

Synopsis

ls [ -r/ecurse | -d/irectory ] [ -l/ong | -s/hort ] [ -vob/_only
| -vie/w_only ] [ -nxn/ame ] [ -vis/ible ] [ pname ... ]

Description

The ls command lists VOB-resident objects, elements loaded into a snapshot view or web view, and view-private objects in a directory.

The default listing includes this information:

  • The name of each element cataloged in the current directory, with the version ID of the particular version in the view. Also included is the version selector part of the config spec rule that selects this version. In a snapshot view, you see the message <rule info unavailable> if ls encounters errors.
  • The name of each view-private object in the current directory
  • In a dynamic view, the name of each derived object (DO) that is visible in the view, along with its unique DO ID

The listing for an element or a derived object in a dynamic view may also include an annotation that indicates an unusual or noteworthy state. For example, the listing for an element that has been checked out to your view identifies the version that was checked out:

hello.c@@/main/CHECKEDOUT from /main/4               Rule: CHECKEDOUT

On Linux and UNIX systems, symbolic links are listed as absolute pathnames by default. To list symbolic links as relative pathnames, set the environment variable CCASE_LS_RELATIVE_SYMLINK_PATH.

Annotations common to all view types

You may see the following annotations when you issue ls from any type of view:

eclipsed
No version of the element is selected because a view-private object with the same name exists in your view. Typical occurrence: you create a view-private file in your view; then an element with the same path name is created in another view. In your view, an ls -vob_only shows the element to be eclipsed.
eclipsed by checkout
(Displayed only when you use the -vob_only option) No version from the element's version tree is selected, because the element has been checked out in this view, and a checked-out version always eclipses all checked-in versions.
checkedout but eclipsed
The element has been checked out in this view, but there is no CHECKEDOUT config spec rule; thus, the checked-out version is not visible in the view.
checkedout but removed
The element was checked out in this view, but the view-private file was subsequently removed. You may have deleted the file. VersionVault removes it (in effect) when you check out a file with checkout -out or when you check out a DO version.
Note: If a file element has several names, by virtue of one or more VOB hard links, checking out the element under one name causes all the other names to be listed with this annotation. (The element is checked out, but there are no view-private files with the other names.)
no version selected
The element is not selected by any config spec rule or is selected by a -none config spec rule.
error on reference
The element is selected by an -error config spec rule.

Annotations on UNIX® and Linux® common to all view types

view-->vob hard link
The object is a view-private (operating system level) hard link to an object in VOB storage.

Annotations specific to dynamic views

You may see the following annotations when you issue ls from a dynamic view:

no config record
(Shareable derived objects only) The derived object's data container is still stored in the view, but the derived object in the VOB database (and, typically, its associated configuration record) have been deleted by rmdo. This can occur only in the view in which the derived object was originally built.
disputed checkout
The element is considered to be checked out by the view_server but is not so indicated in the VOB database (or vice versa). This can occur during the short interval in which a checkin or checkout is in progress. For information about view_server, see the Help.
removed with white out
The derived object was winked in by, and is still referenced by, the current view, but it has been forcibly removed from the VOB database with rmdo. The derived object is not recoverable.

Annotations specific to snapshot and web views

You may see the following annotations when you issue ls from a snapshot or web view:

not loaded
The element is not loaded into the view. Either there are no load rules specifying the element, or the version-selection rules do not select any version of the element.
loaded but missing
A version of the element was loaded into the view, but you have deleted or renamed the file in the view. To copy the version back into the view, use the cleartool get command ( that generates a hijacked file) or update your snapshot or web view, specifying the path name to the missing file.
hijacked
The version in the view was modified without being checked out.
overridden
The element is loaded in the view, but its file type is not the same as the corresponding object in the VOB; or the element is not loaded in the view, but an object with the same name exists in the view.
special selection
The version you checked in (and, hence, the version currently in the view) is not the version that the config spec selects from the VOB. For more information, see the section Actions taken in the view in the checkin reference page.
nocheckout
The version hijacked in the view is no longer the version the config spec selects from the VOB. To prevent losing changes in the version selected by the config spec, you cannot check out the hijacked file. To check in your modifications, you must fix the hijack condition:
  1. Rename the hijacked file and update the file.
  2. Check out the version from which you hijacked the file.
  3. Copy your hijacked file over the checked-out version.
  4. Merge from the current version to your checked-out version.

You can now check in your version.

(You can use the graphical update tool to do the checkout and merge operations.)

deleted version
The version currently in the view has been removed from the VOB (for example, by the rmver command). Use the update command to copy a valid version into the view.

Elements suppressed from the view

The listing includes elements selected with -none and -error config spec rules, and elements that are not selected by any config spec rule. UNIX® and Linux® commands, such as ls(1) and cat(1), return not found errors when accessing such elements. You can specify such elements in commands that access the VOB database only, such as describe, lsvtree, and mklabel.

Restrictions

ACL authorization

If ACLs are enabled, the principal must have the permission read-info on VOB object to list elements or versions.

Non-ACL restrictions

If ACLs are not enabled, no restrictions apply.

Options and arguments

Handling of directory arguments

Default
For each pname that specifies a directory element, ls lists the contents of that directory, but not the contents of any of its subdirectories.
Note: This includes directories in version-extended namespace, which represent elements and their branches. For example, specifying foo.c@@/main/bug403 as an argument lists the contents of that branch: all the versions on the branch.
-r/ecurse
Includes a listing of the entire subtree below any subdirectory included in the top-level listing. VOB symbolic links are not traversed during the recursive descent.
-d/irectory
Lists information on a directory itself, rather than its contents.

Report format

Default
The default report format is described in the Description section.
-l/ong
For each object, lists the config spec rule that matches the object and classifies each object. The classification can be one of: version, directory version, file element, directory element, view-private object, derived object, derived object version, or symbolic link. For each derived object, ls -long indicates whether the DO is nonshareable, unshared, promoted, or shared.
-s/hort
Restricts the listing of each entry to its version-extended path name only.
-nxn/ame
Lists simple path names instead of version-extended path names.

VOB/view restriction

Default
The listing includes both objects in VOB storage and objects in view storage.
-vob/_only
Restricts the listing to objects in the VOB storage, including versions of elements and VOB links. This may also add some entries to the listing: those for the underlying elements that are eclipsed by checked-out versions.
-vie/w_only
Restricts the listing to objects that belong logically to the view: view-private files, view-private directories, and view-private links; checked-out versions; and all derived objects visible in the view.
Note: Checked-out directories are listed by -vob_only, but not by -view_only.
Note: Derived objects visible in the view are listed by -view_only (but not -vob_only), regardless of whether they are (or ever have been) shared.
-vis/ible
Restricts the listing to objects visible to the operating system listing command.

Specifying the objects to be listed

Default
The current working directory (equivalent to specifying a dot (.) as the pname argument). If you do not specify any other options, all files and links in the current working directory are listed; all subdirectory entries are listed, but not the contents of these subdirectories.
pname ...
Restricts the listing to the specified files, directories, links, or both. pname may be a view- or VOB-extended path name to list objects that are not in the view, regardless of whether the view is a snapshot view or a dynamic view (see pathnames_ccase).

Examples

The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.

The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.

In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.

Note: In some examples, output is wrapped for clarity.
  • List the VOB-resident objects and view-private objects in the current working directory.

    cmd-context ls
    Makefile@@/main/3                                   Rule: /main/LATEST
    bug.report
    cm_add.c@@/main/0                                    Rule: /main/LATEST
    cm_fill.c@@/main/0                                   Rule: /main/LATEST
    convolution.c@@/main/CHECKEDOUT from /main/0         Rule: CHECKEDOUT
    edge.sh
    hello@@2007-03-24T11:32.418
    hello.c@@/main/CHECKEDOUT from /main/4               Rule: CHECKEDOUT
    hello.h@@/main/CHECKEDOUT from /main/2               Rule: CHECKEDOUT
    hello.o@@2007-03-24T11:32.412
    hw.c@@/main/4                                        Rule: /main/LATEST
    include@@/main/CHECKEDOUT                             Rule: CHECKEDOUT

  • List the objects in the current working directory, with annotations.

    cmd-context ls -long
    version               Makefile@@\main\3      Rule: element * \main\LATEST
    view private object   bug.report
    version               cm_add.c@@\main\0      Rule: element * \main\LATEST
    derived object (unshared)   hello@@2007-03-24T11:32.418
    version               hello.h@@\main\CHECKEDOUT from \main\2  
                                                  Rule: element * CHECKEDOUT
    derived object (unshared)   hello.o@@2007-03-24T11:32.412
    directory version     include@@\main\CHECKEDOUT 
                                                  Rule: element * CHECKEDOUT
    symbolic link         messages.c --> msg.c
    version               msg.c@@\main\1         Rule: element * \main\LATEST
    view private object   util.c.contrib

  • List only the view-private objects in the current working directory.

    cmd-context ls -view_only
    bug.report
    hello@@2007-03-24T11:32.418
    hello.c@@/main/CHECKEDOUT from /main/4        Rule: CHECKEDOUT
    hello.h@@/main/CHECKEDOUT from /main/2        Rule: CHECKEDOUT
    hello.o@@2007-03-24T11:32.412
    msg.o@@2007-03-23T20:42.379
    util.c@@/main/CHECKEDOUT from /main/4          Rule: CHECKEDOUT
    util.o@@2007-03-24T11:32.415

  • List the contents of the directory in extended namespace that corresponds to the main branch of element util.c.

    cmd-context ls util.c@@\main
    util.c@@\main\0
    util.c@@\main\1
    util.c@@\main\2
    util.c@@\main\3
    util.c@@\main\CHECKEDOUT
    util.c@@\main\LATEST
    util.c@@\main\REL2
    util.c@@\main\REL3
    util.c@@\main\rel2_bugfix

    view private object   util.c.contrib

  • List the directory version that is visible in the current view:

    cmd-context ls -directory -vob_only
    .@@/main/CHECKEDOUT from /main/4        Rule: CHECKEDOUT