Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Panel
Table of Contents

Anchor
1151487
1151487
Syntax

Wiki Markup
*dir* _logical\-name_\[=_directory_\]

Anchor
1151489
1151489
Description

The dir command provides a listing of the specified directory.

If no directory is specified, the current working directory (or qualifier) is used as the specified directory.

When the dir argument results in a "not found" condition, the dir command ends with _rc = 8 and _lastrc = 0 (see #dir "not found" condition, below).

Note
titleNote

The dir command is valid only for the hfs file system.


IBM i

hfs supports the root and QOpenSys file systms under IFS.

z/OS

hfs supports the UNIX System Services file system.

Anchor
1151835
1151835
Parameters

HTML Table
cellspacing0
styletext-align: left; width: 504pt;
classTable_with_Header
Table Row (tr)
Table Cell (td)
stylebackground-color: #F0F0F0; border-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: middle; width: 144pt;

Anchor
1151839
1151839
Parameter

Table Cell (td)
stylebackground-color: #F0F0F0; border-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: middle; width: 360pt;

Anchor
1151841
1151841
Description

Table Row (tr)
Table Cell (td)
styleborder-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: top;

Anchor
1151843
1151843
logical-name

Table Cell (td)
styleborder-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: top;

Anchor
1151845
1151845
Logical name of the transfer server to execute the dir command.

Table Row (tr)
Table Cell (td)
styleborder-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: top;

Anchor
1151847
1151847
directory

Table Cell (td)
styleborder-bottom-color: #E8E8E8; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: #E8E8E8; border-left-style: solid; border-left-width: 1px; border-right-color: #E8E8E8; border-right-style: solid; border-right-width: 1px; border-top-color: #E8E8E8; border-top-style: solid; border-top-width: 1px; padding-bottom: 3pt; padding-left: 4pt; padding-right: 4pt; padding-top: 4pt; vertical-align: top;

Anchor
1151853
1151853
Directory to list. This can be a relative path.

Anchor
1151855
1151855
Examples

Anchor
1152960
1152960
The following examples assume that the logical name remotesys is valid.


Anchor
1152962
1152962
To list the contents of the current directory:

Panel


Anchor
1152965
1152965
To list the contents of the /home/max/tmp directory:

Panel

Info
titleWindows


Anchor
1152968
1152968
To list the contents of the relative path tmp directory:

Panel

Anchor
1153036
1153036
(The output will be the same as /home/max/tmp assuming that the current working directory is /home/max.)


Anchor
dir "not found" condition
dir "not found" condition

dir "not found" condition

If the dir argument results in a "not found" condition, the dir command ends with _rc = 8 and _lastrc = 0.

Panel

This results in _rc = 8 and _lastrc = 0.


In the instance where a wild card is used, finding no files to return results in _rc = 0 and _lastrc = 0.

Panel

This results in _rc = 0 and _lastrc = 0 and no files listed.

Sample Output

The following is a sample dir command output:

Panel


Each file type is identified as:

  • "file": Files and symbolic links
  • "directory": Directories
  • "FIFO": FIFOs
  • "character": UNIX domain socket and other character devices
  • "block": Block oriented devices
  • "socket": Socket links
  • "external": External links (z/OS only)
  • "unknown": File type could not be determined
    Anchor
    1152970
    1152970

Anchor
1151703
1151703

Anchor
1151710
1151710