Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

DIR AmigaDOS
Purpose: To display a sorted list of the files in a directory.
Format: DIR [<directory> | <pattern>] [OPT A | I | AI | D | F] [ALL] [DIRS] [FILES] [INTER] [SHOWPROGRAMS] [MAXCOLUMNS <number of columns>]
Template: DIR, OPT/K, ALL/S, DIRS/S, FILES/S, INTER=INTERACTIVE/S, SHOWPROGRAMS/S, MAXCOLUMNS/K/N
Path: C:DIR
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.
SHOWPROGRAMS Executable programs and script files will be highlighted in the listing, by printing their names in boldfaced script.
MAXCOLUMNS How many file names will be printed per line depends upon the width of the output window and the lengths of the file names. You can, however, limit how many names will be printed in each line by specifying the maximum number of columns.

NOTE: 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; type the letters D, E, then 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-mode commands.

The COMMAND option enables almost any AmigaDOS command to be executed during the interactive directory list. When you want to issue a command, type C (or COM) at the question mark prompt. DIR will ask you for the command. Type 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.

For instance, C "type prefs.info hex" is equivalent to pressing Q to exit interactive listing mode and return to a regular Shell prompt, and typing:

3.OS4:> 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:

3.OS4:> DIR Workbench4.0: displays a list of the directories and files on the Workbench4.0 disk.

Example 2:

3.OS4:> DIR MyDisk:#?.memo displays all the directories and files on MyDisk that end in .memo.

Example 3:

3.OS4:> DIR Extras4.0: ALL displays the complete contents of the Extras4.0 disk -- all directories, all subdirectories and all files.

Example 4:

3.OS4:> DIR Workbench4.0: DIRS displays only the directories on Workbench4.0.

Example 5:

3.OS4:> DIR Workbench4.0: INTER provides an interactive list of the contents of Workbench4.0.

See Also: LIST


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.