[AmigaOS / ApolloOS Command Reference\Dir] 
 

DIR

Format: DIR [<dir|pattern>] [OPT A|I|AI|D|F] [ALL] [DIRS] [FILES] [INTER] Template: DIR, OPT/K, ALL/S, DIRS/S, FILES/S, INTER/S Purpose: To display a sorted list of the files in a directory. Path: C:DIR Specification: DIR displays the file and directory names contained in the specified directory or the current directory. If no name is given, directories are listed first, followed by an alphabetical list of the files in two columns. Pressing Ctrl+C aborts a directory listing. The options are:

ALL

Displays all subdirectories and their files.

DIRS

Displays only directories.

FILES

Displays only files.

INTER

Enters an interactive listing mode. The ALL, DIRS, FILES and INTER keywords supersede the OPT A, D, F and I options, respectively. The older keywords are retained for compatibility with earlier versions of AmigaDOS. Do not use OPT with the full keywords - ALL, DIRS, FILES, or INTER. The interactive listing mode stops after each name and displays a question mark at which you can enter commands. The acceptable responses are shown below:

Return

Displays the next name on the list.

E

Enters a directory; the files in that directory will be displayed.

B

Goes back one directory level.

DEL or DELETE

Deletes a file or empty directory. DEL does not refer to the Del key; enter the letters D, E, and L.

T

Types the contents of a file.

C or COMMAND

Allows you to enter additional AmigaDOS commands.

Q

Quits interactive editing.

?

Displays a list of the available interactive-mod commands. The COMMAND option allows almost any AmigaDOS command to be executed during the interactive directory list. When you want to issue a command, enter C (or COMMAND) at the question mark prompt. DIR will ask you for the command. Enter the desired command, then press Return. The command will be executed and DIR will continue. You can also combine the C and the command on one line, by putting the command in quotes following the C. Example: 1> DIR INTER C (dir) ? c "type prefs.info hex" Is equivalent to pressing Q to exit interactive listing mode and return to a regular Shell prompt, and entering: 1> TYPE Prefs.info HEX The Prefs.info file would be typed to the screen in hexadecimal format. It is dangerous to format a disk from the DIR interactive mode, as the format will take place immediately, without any confirmation requesters appearing. Also, starting another interactive DIR from interactive mode will result in garbled output. Example 1: 1> DIR Workbench: Displays a list of the directories and files on the Workbench disk. Example 2: 1> DIR MyDisk:#?.memo Displays all the directories and files on MyDisk that end in .memo. Example 3: 1> DIR Extras: ALL Displays the complete contents of the Extras disk-all directories, all subdirectories and all files, including those in the subdirectories. Example 4: 1> DIR Workbench: DIRS Displays only the directories on Workbench. Example 5: 1> DIR Workbench: INTER Provides an interactive list ofthe contents of the Workhench disk.