1 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 2 Parameter filespec[,...] Specifies one or more files to be listed. The syntax of a file specification determines which files will be listed, as follows: o If you do not enter a file specification, the DIRECTORY command lists all versions of the files in the current default directory. o If you specify only a device name, the DIRECTORY command uses your default directory specification. o 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. o If a file specification contains a file name or a file type, or both, and no version number, the DIRECTORY command lists all versions. o 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. o 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. 2 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, see 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 /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, see the OpenVMS User's Manual or the topic SPECIFY Date_Time in online help. /BRIEF /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 /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, see the OpenVMS Guide to System Security. /COLUMNS /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 /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 /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 /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 File attributes Record format Record attributes RMS attributes Journaling information File protection Access control list (ACL) 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 /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 /HIGHLIGHT[=keyword] /NOHIGHLIGHT (default) 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 /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=[JONES]), 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 /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 /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 (^ ), Ctrl/B Scroll up one line. Down arrow (v ) Scroll down one line. Left arrow (< - ) Scroll left one column. Right arrow (- > ) 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), Get the next page of information. Return, Enter, Space 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 /PROTECTION /NOPROTECTION (default) Controls whether the file protection for each file is listed. /SEARCH /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, see the OpenVMS Guide to System Security. /SELECT /SELECT=(keyword[,...]) Allows you to select files for display. Choose one of the following keywords: ACL Displays files that have an associated ACL NOACL or files that do not (NOACL keyword). 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 Displays files that are online or shelved. NOONLINE SHELVABLE Displays files that are shelvable or not NOSHELVABLE 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, Displays files whose block MAXIMUM=n) size falls within the specified MINIMUM and MAXIMUM range. By default, file selection is based on other criteria. /SHELVED_STATE Displays whether the file is shelved or online. /SINCE /SINCE[=time] Selects only those files dated 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, see the OpenVMS User's Manual or the topic SPECIFY Date_Time in online help. /SIZE /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. /TIME /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 /TRAILING /NOTRAILING Controls whether trailing lines that provide the following summary information are displayed: o Number of files listed o Total number of blocks used per directory o Total number of blocks allocated o 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 /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 /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 /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. 2 Examples 1.$ DIRECTORY AVERAGE.* Directory DISK$DOCUMENT:[MALCOLM] 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:[MALCOLM] AVERAGE.EXE;6 6 19-APR-1995 15:43:02.10 (RE,RE,RWED,RE) AVERAGE.FOR;6 2 19-APR-1995 10:29:53.37 (RE,RE,RWED,RE) AVERAGE.LIS;4 5 19-APR-1995 16:27:27.19 (RE,RE,RWED,RE) AVERAGE.OBJ;6 2 19-APR-1995 16:27:44.23 (RE,RE,RWED,RE) Total of 4 files, 15 blocks. In this example, the DIRECTORY command lists the number of blocks used, the creation date, and the file protection code for the highest version number of all files named AVERAGE in the current directory. 3.$ DIRECTORY/FULL DISK$GRIPS_2:[VMS.TV]DEMO.EXE Directory DISK$GRIPS_2:[VMS.TV] DEMO.EXE;1 File ID: (36,11,0) Size: 390/390 Owner: [0,0] Created: 12-NOV-1995 11:45:19.00 Revised: 14-DEC-1995 15:45:19.00 (34) Expires: <None specified> Backup: 28-NOV-1995 04:00:12.22 Effective: <None specified> Recording: <None specified> File organization: Sequential Shelved state: Online File attributes: Allocation: 390, Extend: 0, Global buffer count: 0, Version limit: 0, Backups disabled, Not shelvable Record format: Fixed length 512 byte records Record attributes: None RMS attributes: None Journaling enabled: None File protection: System:RE, Owner:RE, Group:RE, World:RE Access Cntrl List: None Total of 1 file, 390/390 blocks. The example illustrates the DIRECTORY/FULL command. 4.$ DIRECTORY/VERSIONS=1/COLUMNS=1 AVERAGE.* The DIRECTORY command in this example lists only the highest version of each file named AVERAGE in the current default directory. The format is brief and restricted to one column. Heading and trailing lines are provided. 5.$ DIRECTORY BLOCK%%% The DIRECTORY command in this example locates all versions and types of files in the default device and directory whose names begin with the letters BLOCK and end with any three additional characters. The default output format is brief, four columns, with heading and trailing lines. 6.$ DIRECTORY/EXCLUDE=(AVER.DAT;*,AVER.EXE;*) [*...]AVER The DIRECTORY command in this example lists and totals all versions and types of files named AVER in all directories and subdirectories on the default disk, except any files named AVER.DAT and AVER.EXE. 7.$ DIRECTORY/SIZE=ALL FRESNO::DISK1:[TAYLOR]*.COM The DIRECTORY command in this example lists all versions of all files with the file type COM in the directory TAYLOR on node FRESNO and device DISK1. The listing includes the file size both in blocks used and in blocks allocated for each file. 8.$ DIRECTORY- _$ /MODIFIED/SINCE=14-DEC-1995:01:30/SIZE=ALL/OWNER- _$ /PROTECTION/OUTPUT=UPDATE/PRINTER [A*] The DIRECTORY command in this example locates all files that have been modified since 1:30 a.m. on December 14, 1995, and that reside on the default disk in all directories whose names begin with the letter A. It formats the output to include all versions, the size used and size allocated, the date last modified, the owner, and the protection codes. The output is directed to a file named UPDATE.LIS, which is queued automatically to the default printer queue and then is deleted. 9.$ DIRECTORY/SHELVED_STATE Directory MYDISK:[SMITH] MYFILE.TXT;2 Online NOT_SHELVED.TXT;1 Online SHELVED.TXT Shelved Total of 3 files. The DIRECTORY command in this example lists all the files in a directory and shows whether a file is shelved, online, or remote.