Document revision date: 30 March 2001

## OpenVMS DCL Dictionary

Previous | Contents | Index

## DIRECTORY

> Provides a list of files or information about a file or group of files.

> Requires execute (E) access to look up files you know the names of, read (R) access to read or list a file or to use a file name with the asterisk (*) and the percent sign (%) wildcard characters to look up files.

### Format

> DIRECTORY [filespec[,...]]

> DIRECTORY/FTP directorySpec

### Parameter

> #### filespec[,...]

> Specifies one or more files to be listed. The syntax of a file specification determines which files will be listed, as follows:
> - If you do not enter a file specification, the DIRECTORY command lists all versions of the files in the current default directory.
> - If you specify only a device name, the DIRECTORY command uses your default directory specification.
> - Whenever the file specification does not include a file name, a file type, and a version number, all versions of all files in the specified directory are listed.
> - If a file specification contains a file name or a file type, or both, and no version number, the DIRECTORY command lists all versions.
> - If a file specification contains only a file name, the DIRECTORY command lists all files in the current default directory with that file name, regardless of file type and version number.
> - If a file specification contains only a file type, the DIRECTORY command lists all files in the current default directory with that file type, regardless of file name and version number.

> The asterisk (*) and the percent sign (%) wildcard characters can be used in the directory specification, file name, file type, or version number fields of a file specification to list all files that satisfy the components you specify. If you specify more than one file, separate the file specifications with either commas (,) or plus signs (+).

> #### directorySpec

> Specifies the standard DECnet remote file specification. Use a quoted file string to preserve the case (for case sensitive systems such as UNIX) and to identify a foreign device/directory specification. See the /FTP qualifier for more information.

### Description

> The DIRECTORY command lists the files contained in a directory. When you use certain qualifiers with the command, additional information is displayed, along with the names of the files.

> The output of the DIRECTORY command depends on certain formatting qualifiers and their defaults. These qualifiers are as follows: /COLUMNS, /DATE, /FULL, /OWNER, /PROTECTION, and /SIZE. However, the files are always listed in alphabetical order, with the highest numbered versions listed first.

> In studying the qualifiers and the capabilities they offer, watch for qualifiers that work together and for qualifiers that override other qualifiers. For example, if you specify the /FULL qualifier, the system cannot display all the information in more than one column. Thus, if you specify both the /COLUMNS and /FULL qualifiers, the number of columns you request is ignored.

> You can also select other languages and formats that have been defined on your systems with international date and time formatting routines available in the run-time library. Refer to the OpenVMS RTL Library (LIB$) Manual.

### Qualifiers

> #### /ACL

> Controls whether the access control list (ACL) is displayed for each file. By default, the DIRECTORY command does not display the ACL for each file. Access control entries (ACEs) that were created with the hidden option are displayed only if the SECURITY privilege is turned on. The /ACL qualifier overrides the /COLUMNS qualifier.

> For further information, refer to the OpenVMS Guide to System Security.

> #### /BACKUP

> Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /BACKUP qualifier selects files according to the dates of their most recent backups. This qualifier is incompatible with the /CREATED, /EXPIRED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.

> #### /BEFORE[=time]

> Selects only those files dated prior to the specified time. You can specify time as an absolute time, as a combination of absolute and delta times, or as one of the following keywords: BOOT, LOGIN, TODAY (default), TOMORROW, or YESTERDAY. Specify one of the following qualifiers with the /BEFORE qualifier to indicate the time attribute to be used as the basis for selection: /BACKUP, /CREATED (default), /EXPIRED, or /MODIFIED.

> For complete information on specifying time values, refer to the OpenVMS User's Manual or the online help topic DCL_Tips (subtopic Date_Time).

> #### /BRIEF (default)

> Displays only a file's name, type, and version number. The brief format lists the files in alphabetical order from left to right on each line, in descending version number order. You can use the /ACL, /DATE, /FILE_ID, /FULL, /NOHEADING, /OWNER, /PROTECTION, /SECURITY, and /SIZE qualifiers to expand a brief display.

> #### /BY_OWNER[=uic]

> Selects only those files whose owner user identification code (UIC) matches the specified owner UIC. The default UIC is that of the current process.

> Specify the UIC by using standard UIC format as described in the OpenVMS User's Manual.

> For further information, refer to the OpenVMS Guide to System Security.

> #### /CACHING_ATTRIBUTE

> Displays the caching attributes of the selected files.

> #### /COLUMNS=n

> Specifies the number of columns in a brief display. The default is four; however, you can request as many columns as you like, restricted by the value of the /WIDTH qualifier. The /COLUMNS qualifier is incompatible with the /ACL, /FULL, and /SECURITY qualifiers.

> The number of columns actually displayed depends on the amount of information requested for each column and the display value of the /WIDTH qualifier. The system displays only as many columns as can fit within the default or specified display width, regardless of how many columns you specify with the /COLUMNS qualifier.

> The DIRECTORY command truncates long file names only when you specify more than one column and you have asked for additional information to be included in each column. The default file name size is 19 characters. Use the /WIDTH qualifier to change the default. When a file name is truncated, the system displays one less character than the file name field size and inserts a vertical bar in the last position. For example, if the file name is SHOW_QUEUE_CHARACTERISTICS, and if you requested DIRECTORY to display both file name and size in each column, the display for that file would be SHOW_QUEUE_CHARACT| 120.

> #### /CREATED (default)

> Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /CREATED qualifier selects files based on their dates of creation. This qualifier is incompatible with the /BACKUP, /EXPIRED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.

> #### /DATE[=option]

> #### /NODATE (default)

> Includes the creation, last modification, expiration, backup, effective, or recording date for each specified file; the default is the /NODATE qualifier. If you use the /DATE qualifier without an option, the creation date is provided. Possible options are as follows:

> Option | Description
> --- | ---
> ALL | Specifies all optional dates in the following order: creation, last modification, expiration, backup, effective, and recording.
> BACKUP | Specifies the last backup date.
> CREATED | Specifies the creation date.
> EFFECTIVE | Specifies the effective date the contents are valid (ISO 9660).
> EXPIRED | Specifies the expiration date.
> MODIFIED | Specifies the last modification date.
> RECORDING | Specifies the recording date on the media (ISO 9660).

> #### /EXACT

> Use with the /PAGE=SAVE and /SEARCH qualifiers to specify a search string that must match the search string exactly and must be enclosed with quotation marks (" ").

> If you specify the /EXACT qualifier without the /SEARCH qualifier, exact search mode is enabled when you set the search string with the Find (E1) key.

> #### /EXCLUDE=(filespec[,...])

> Excludes the specified files from the DIRECTORY command. You can include a directory but not a device in the file specification. The asterisk (*) and the percent sign (%) wildcard characters are allowed in the file specification; however, you cannot use relative version numbers to exclude a specific version. If you specify only one file, you can omit the parentheses.

> #### /EXPIRED

> Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /EXPIRED qualifier selects files according to their expiration dates. (The expiration date is set with the SET FILE/EXPIRATION_DATE command.) The /EXPIRED qualifier is incompatible with the /BACKUP, /CREATED, and /MODIFIED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time qualifiers, the default is the /CREATED qualifier.

> #### /FILE_ID

> Controls whether the file identification (FID) number is displayed. By default, the FID is not displayed unless the /FULL qualifier is specified.

> #### /FTP

> Invokes the directory (dir or ls) operation of the FTP utility. The DIRECTORY/FTP command writes a listing of the contents of the specified remote directory to the local host over a TCP/IP connection by invoking the FTP utility.

> #### /FULL

> Displays the following information for each file:

> > File name
> > File type
> > Version number
> > File identification number (FID)
> > Number of blocks used
> > Number of blocks allocated
> > File owner's user identification code (UIC)
> > Date of creation
> > Date last modified and revision number
> > Date of expiration
> > Date of last backup
> > Date of effective usage
> > Date of recording on media
> > File organization
> > Shelved state
> > Caching attribute
> > File attributes
> > Record format
> > Record attributes
> > RMS attributes
> > Journaling information
> > File protection
> > Access control list (ACL)
> > Client attribute
> > Value of the stored semantics tag (where applicable)

> #### /GRAND_TOTAL

> Displays only the totals for all files and directories that have been specified. Suppresses both the per-directory total and individual file information. (See the /TRAILING qualifier for information on displaying directory totals.)

> #### /HEADING

> #### /NOHEADING

> Controls whether heading lines consisting of a device description and directory specification are printed. The default output format provides this heading. When the /NOHEADING qualifier is specified, the display is in single-column format and the device and directory information appears with each file name. The /NOHEADING qualifier overrides the /COLUMNS qualifier.

> The combination of the /NOHEADING and /NOTRAILING qualifiers is useful in command procedures where you want to create a list of complete file specifications for later operations.

> #### /HIGHLIGHT[=keyword]

> Use with the /PAGE=SAVE and /SEARCH qualifiers to specify the type of highlighting you want when a search string is found. When a string is found, the entire line is highlighted. You can use the following keywords: BOLD, BLINK, REVERSE, and UNDERLINE. BOLD is the default highlighting.

> #### /MODIFIED

> Modifies the time value specified with the /BEFORE or the /SINCE qualifier. The /MODIFIED qualifier selects files according to the dates on which they were last modified. This qualifier is incompatible with the /BACKUP, /CREATED, and /EXPIRED qualifiers, which also allow you to select files according to time attributes. If you specify none of these four time modifiers, the default is the /CREATED qualifier.

> #### /OUTPUT[=filespec]

> #### /NOOUTPUT

> Controls where the output of the command is sent. By default, the display is written to the current SYS$OUTPUT device. The asterisk (*) and the percent sign (%) wildcard characters are not allowed.

> If you enter the /OUTPUT qualifier with a partial file specification (for example, /OUTPUT=[KIER]), DIRECTORY is the default file name and .LIS the default file type. If you enter the /NOOUTPUT qualifier, output is suppressed.

> If the output will be written to a file in the same directory, the output file name will appear in the directory listing.

> #### /OWNER

> #### /NOOWNER (default)

> Controls whether the file owner's user identification code (UIC) is listed.

> The default size of the owner field is 20 characters. If the file owner's UIC exceeds the length of the owner field, the information will be truncated. The size of this field can be altered by specifying /WIDTH=OWNER, along with a value for the owner field. For more information, see the description of the /WIDTH qualifier.

> #### /PAGE[=keyword]

> #### /NOPAGE (default)

> Controls the display of directory information on the screen.

> You can use the following keywords with the /PAGE qualifier:

> CLEAR_SCREEN | Clears the screen before each page is displayed.
> SCROLL | Displays information one line at a time.
> SAVE[= n] | Enables screen navigation of information, where n is the number of pages to store.

> The /PAGE=SAVE qualifier allows you to navigate through screens of information. The /PAGE=SAVE qualifier stores up to 5 screens of up to 255 columns of information. When you use the /PAGE=SAVE qualifier, you can use the following keys to navigate through the information:

> Key Sequence | Description
> --- | ---
> Up arrow key, Ctrl/B | Scroll up one line.
> Down arrow key | Scroll down one line.
> Left arrow key | Scroll left one column.
> Right arrow key | Scroll right one column.
> Find (E1) | Specify a string to find when the information is displayed.
> Insert Here (E2) | Scroll right one half screen.
> Remove (E3) | Scroll left one half screen.
> Select (E4) | Toggle 80/132 column mode.
> Prev Screen (E5) | Get the previous page of information.
> Next Screen (E6), Return, Enter, Space | Get the next page of information.
> F10, Ctrl/Z | Exit. (Some utilities define these differently.)
> Help (F15) | Display utility help text.
> Do (F16) | Toggle the display to oldest/newest page.
> Ctrl/W | Refresh the display.

> The /PAGE qualifier is not compatible with the /OUTPUT qualifier.

> #### /PRINTER

> Puts the display in a file and queues the file to SYS$PRINT for printing under the name given by the /OUTPUT qualifier. If you do not specify the /OUTPUT qualifier, output is directed to a temporary file named DIRECTORY.LIS, which is queued for printing and then is deleted.

> #### /PROTECTION

> #### /NOPROTECTION (default)

> Controls whether the file protection for each file is listed.

> #### /SEARCH="string"

> Use with the /PAGE=SAVE qualifier to specify a string that you want to find in the information being displayed. Quotation marks are required for the /SEARCH qualifier, if you include spaces in the text string.

> You can also dynamically change the search string by pressing the Find key (E1) while the information is being displayed. Quotation marks are not required for a dynamic search.

> #### /SECURITY

> Controls whether information about file security is displayed; using the /SECURITY qualifier is equivalent to using the /ACL, /OWNER, and /PROTECTION qualifiers together. ACEs that were created with the hidden option are displayed only if the SECURITY privilege is turned on.

> For further information, refer to the OpenVMS Guide to System Security.

> #### /SELECT=(keyword[,...])

> Allows you to select files for display. Choose one of the following keywords:

> ACL NOACL | Displays files that have an associated ACL or files that do not (NOACL keyword).
> CACHING_ATTRIBUTE=(option[,...]) | Displays files that have the specified caching attribute. Possible options are: NO_CACHING WRITETHROUGH
> FILE=(option[,...]) | Displays portions of the file specification. The /SELECT=FILE qualifier is used to turn off specific portions by explicit or implicit specification of the options. Possible options are: [NO]NODE [NO]DEVICE [NO]DIRECTORY [NO]NAME [NO]TYPE [NO]VERSION /SELECT=FILE qualifier cannot be used with the /FULL qualifier.
> ONLINE NOONLINE | Displays files that are online or shelved.
> PRESHELVED NOPRESHELVED | Displays files that are preshelved or not preshelved.
> SHELVABLE NOSHELVABLE | Displays files that are shelvable or not shelvable.
> SIZE=(option[,...]) | Displays files according to their size. Possible options are:
> Option | Description
> --- | ---
> MAXIMUM= n | Displays files that have fewer blocks than the value of n, which defaults to 1,073,741,823. Use with MINIMUM=n to specify a size range for files to be displayed.
> MINIMUM= n | Displays files that have blocks equal to or greater than the value of n. Use with MAXIMUM=n to specify a size range for files to be displayed.
> (MINIMUM= n, MAXIMUM= n) | Displays files whose block size falls within the specified MINIMUM and MAXIMUM range.

> #### /SHELVED_STATE

> Displays whether the file is shelved, preshelved, or online.

> #### /SINCE[=time]

> Selects only those files dated on or after the specified time. You can specify time as an absolute time, as a combination of absolute and delta times, or as one of the following keywords: BOOT, LOGIN, TODAY (default), TOMORROW, or YESTERDAY. Specify one of the following qualifiers with the /SINCE qualifier to indicate the time attribute to be used as the basis for selection: /BACKUP, /CREATED (default), /EXPIRED, or /MODIFIED.

> For complete information on specifying time values, refer to the OpenVMS User's Manual or the online help topic DCL_Tips (subtopic Date_Time).

> #### /SIZE[=option]

> #### /NOSIZE (default)

> Displays the size in blocks of each file. If you omit the option parameter, the default lists the file size in blocks used (USED). Specify one of the following options:

> ALL | Lists the file size both in blocks allocated and blocks used.
> ALLOCATION | Lists the file size in blocks allocated.
> USED | Lists the file size in blocks used.

> The size of this field can be altered by supplying the size value of the /WIDTH qualifier.

> #### /STYLE=keyword[,keyword]

> Specifies the file name format for display purposes while displaying directory contents.

> The valid keywords for this qualifier are CONDENSED and EXPANDED. Descriptions are as follows:

> Keyword | Explanation
> --- | ---
> CONDENSED (default) | Displays the file name representation of what is generated to fit into a 255-length character string. This file name may contain a DID or FID abbreviation in the file specification.
> EXPANDED | Displays the file name representation of what is stored on disk. This file name does not contain any DID or FID abbreviations.

> If both CONDENSED and EXPANDED keywords are specified, then the file specifications are displayed in two columns. The column size is dependent on the display width, and the file names wrap within their respective columns.

> File errors are displayed with the CONDENSED file specification unless the EXPANDED keyword is specified.

> Refer to the OpenVMS Guide to Extended File Specifications for more information.

> #### /TIME[=option]

> #### /NOTIME (default)

> The same as the /DATE qualifier: includes the backup, creation, expiration, or modification time for each specified file; the default is the /NOTIME qualifier. If you use the /TIME qualifier without an option, the creation time is provided. Possible options are as follows:

> Option | Description
> --- | ---
> ALL | Specifies creation, expiration, backup, and last modification times.
> BACKUP | Specifies the last backup time.
> CREATED | Specifies the creation time.
> EFFECTIVE | Specifies the effective time the contents are valid.
> EXPIRED | Specifies the expiration time.
> MODIFIED | Specifies the last modification time.
> RECORDING | Specifies the recording time on the media.

> #### /TOTAL

> Displays only the directory name and total number of files.

> By default, the output format is determined by the /BRIEF qualifier, which gives this total but also lists all the file names, file types, and their version numbers.

> #### /TRAILING

> #### /NOTRAILING

> Controls whether trailing lines that provide the following summary information are displayed:
> - Number of files listed
> - Total number of blocks used per directory
> - Total number of blocks allocated
> - Total number of directories and total blocks used or allocated in all directories (only if more than one directory is listed)

> By default, the output format includes most of this summary information. The /SIZE and /FULL qualifiers determine more precisely what summary information is included.

> When used alone, the /TRAILING qualifier lists the number of files in the directory. When used with the /SIZE qualifier, the /TRAILING qualifier lists the number of files and the number of blocks (displayed according to the option of the /SIZE qualifier, FULL or ALLOCATION). When used with the /FULL qualifier, the /TRAILING qualifier lists the number of files as well as the number of blocks used and allocated. If more than one directory is listed, the summary includes the total number of directories, the total number of blocks used, and the total number of blocks allocated.

> #### /VERSIONS=n

> Specifies the number of versions of a file to be listed. The default is all versions of each file. A value less than 1 is not allowed.

> #### /WIDTH=(keyword[,...])

> Formats the width of the display. If you specify only one keyword, you can omit the parentheses. Possible keywords are as follows:

> DISPLAY= n | Specifies the total width of the display as an integer in the range 1 to 256 and defaults to zero (setting the display width to the terminal width). If the total width of the display exceeds the terminal width, the information will be truncated.
> FILENAME= n | Specifies the width of the file name field; defaults to 19 characters. If you request another piece of information to be displayed along with the file name in each column, file names that exceed the n parameter cause the line to wrap after the file name field. (See the /COLUMNS qualifier.)
> OWNER= n | Specifies the width of the owner field; defaults to 20 characters. If the owner's user identification code (UIC) exceeds the length of the owner field, the information will be truncated.
> SIZE= n | Specifies the width of the size field; defaults to 6 characters on systems prior to OpenVMS Version 6.0; the default is 7 characters on OpenVMS Version 6.0 systems or higher. If the file size exceeds the length of the size field, the field is filled with asterisks.

> #### /WRAP

> #### /NOWRAP (default)

> Use with the /PAGE=SAVE qualifier to limit the number of columns to the width of the screen and to wrap lines that extend beyond the width of the screen to the next line.

> The /NOWRAP qualifier extends lines beyond the width of the screen and can be seen when you use the scrolling (left and right) features provided by the /PAGE=SAVE qualifier.

### Examples

#1
    $ DIRECTORY AVERAGE.*

    Directory DISK$DOCUMENT:[SOUDER]

    AVERAGE.EXE;6      AVERAGE.FOR;6      AVERAGE.LIS;4     AVERAGE.OBJ;12

    Total of 4 files.

> In this example, the DIRECTORY command lists all files with the file name AVERAGE and any file type.

#2
    $ DIRECTORY/SIZE=USED/DATE=CREATED/VERSIONS=1/PROTECTION  AVERAGE

    Directory DISK$DOCUMENT:[SLOUGH]

    AVERAGE.EXE;6       6        19-DEC-2001 15:43:02.10 (RE,RE,RWED,RE)
    AVERAGE.FOR;6       2        19-DEC-2001 10:29:53.37 (RE,RE,RWED,RE)
    AVERAGE.LIS;4       5        19-DEC-2001 16:27:27.19 (RE,RE,RWED,RE)
    AVERAGE.OBJ;6       2        19-DEC-2001 16:27:44.23 (RE,RE,RWED,RE)

    Total of 4 files, 15 blocks.

> Previous | Next | Contents | Index

> | privacy and legal statement |
> 9996PRO_015.HTML