@DATABASE "ADB08"
@INDEX "ADB:Misc/Index.Text/Main"
@HELP "ADB:Misc/Help/Main"
@NODE "Main" "AmigaDOS For Beginners - Part 8 - The DIR Command"

@{B}@{U}@{JCENTER}AMIGADOS FOR BEGINNERS

BY FRANK BUNTON

@{" COPYRIGHT © FRANK P. BUNTON 1993-1997 " LINK "ADB:Misc/Read_Me_First!!/Copyright"}

PART 8 - THE DIR COMMAND@{UB}@{UU}
@{JLEFT}
@{B}Location@{UB}     - "c" directory (all versions)

@{B}Purpose@{UB}      - To display the contents of a directory

@{B}Availability@{UB} - All AmigaDOS Versions
@{JCENTER}
@{" General Usage      " LINK "General"}                           
@{" Options - Comments " LINK "Options"}                           
@{" The ALL   Option   " LINK "All"} All AmigaDOS Versions     
@{" The DIRS  Option   " LINK "Dirs"} All AmigaDOS Versions     
@{" The FILES Option   " LINK "Files"} AmigaDOS v1.3 onwards only
@{" The INTER Option   " LINK "Inter"} All AmigaDOS Versions     
@{" The AI    Option   " LINK "AI"} All AmigaDOS Versions     

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "General" "Part 8 - The DIR Command - General Usage"

@{B}@{U}The DIR Command - General Usage@{UB}@{UU}

The next command to master is "DIR". If entered on its own:-

  > DIR

it will show you the contents of the @{B}current directory@{UB}, i.e. the names
of all sub-directories with "(DIR)" after them and the names of all the
current directory's files. It will not show the contents of the
sub-directories (but see @{"options" LINK "Options"}).

It can also be used with the name of any directory so that you can view
the contents of a directory without making it the current directory. For
example, if the current directory is the root of the Workbench disk, you
can view the contents of "devs/printers" by entering:-

  > DIR devs/printers

If you are in a different path to the "devs/printers" directory, e.g.
if the current directory is, say, "df0:fonts/topaz" you can view
"devs/printers" by entering one of:-

  > DIR df0:devs/printers
  > DIR :devs/printers

If the current directory is on the disk in df0: and you wish to see a
directory on the disk in df1: you can use:-

  > df1:path-name/dir-name

Try using DIR as follows:-

  > DIR Sys:

(Note that "Sys:" is the disk you booted from - either your floppy
"Workbench" disk or the "Workbench" partition of your hard drive.)

For a floppy disk you should see something like this appear (for v3.1):-

     WBStartup (dir)
     C (dir)
     Classes (dir)
     L (dir)
     Devs (dir)
     Expansion (dir)
     Libs (dir)
     Prefs (dir)
     Rexxc (dir)
     S (dir)
     System (dir)
     T (dir)
     Utilities (dir)
  Devs.info                        Disk.info
  Expansion.info                   Prefs.info
  System.info                      Utilities.info
  WBStartup.info

Users with a hard drive system will see some extra items.

Users of workbench versions other than 3.1 will see somewhat different
contents.

@{B}@{U}"Hidden" Directories@{UB}@{UU}

The first thing to note is that this shows 13 directories (v3.1) whereas,
when the disk icon is opened, the disk window shows only 7 drawers (v3.1).
The other 6 directories in v3.1 are "hidden" when you are using only the
Workbench screen.

@{B}In v2+@{UB} these are not really hidden directories as you can view them in
Workbench by selecting the "Window/Show/All Files" menu item.

All the file names that end in ".info" are, simply put, the actual icons
that appear in the Workbench windows. Thus "disk.info" is the disk's icon,
"System.info" is the icon for the "System" drawer, and so on. If a drawer
or file does not have a corresponding ".info" file, then it does not have
an icon and is hidden from Workbench v1.x and from Workbench2+ unless
the "Window/Show/All Files" menu item is used.

Sometimes you may see a file named simply ".info". This is @{B}not@{UB} an icon
but a sort of "housekeeping" file that has information about the directory
window and what is in it. It was used in some earlier versions of AmigaDOS.

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Options" "Part 8 - The DIR Command - Options"

@{B}@{U}DIR Command "Options"@{UB}@{UU}

The options available for use with DIR are:-

@{" The ALL   Option   " LINK "All"} All AmigaDOS Versions
@{" The DIRS  Option   " LINK "Dirs"} All AmigaDOS Versions
@{" The FILES Option   " LINK "Files"} AmigaDOS v1.3 onwards only
@{" The INTER Option   " LINK "Inter"} All AmigaDOS Versions
@{" The AI    Option   " LINK "AI"} All AmigaDOS Versions

They can be used on the current directory, as in this example of the
ALL option:-

  > DIR OPT A

or, if you are using a directory name, put that directory name first then
the option, as in one of:-

  DIR Dirname OPT A          (for a directory on the current disk)
  DIR Device:Dirname OPT A   (for a directory on a different disk)

However, for the sake of simplicity, I will describe the options as though
they are being applied to the current directory.

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "All" "Part 8 - The DIR Command - The ALL Option"

@{B}@{U}The ALL Option@{UB}@{UU}

The ALL option has one of these formats:-

  > DIR OPT A  (@{B}v1.2, v1.3 & v2+@{UB}) (meaning option all)
  > DIR ALL    (@{B}v1.3 & v2+@{UB})

This will show not only a list of the contents of the current directory,
but also the contents of any sub-directories within the current directory.
Try it on the Workbench disk root directory to get an idea of how it works.
(Press CTRL-C to stop the listing if you like.)

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Dirs" "Part 8 - The DIR Command - The DIRS Option"

@{B}@{U}The DIRS Option@{UB}@{UU}

If you wish to view ONLY the names of the DIRECTORIES within the directory
then you can use one of:-

  > DIR OPT D   (@{B}v1.2 onwards@{UB})
  > DIR DIRS    (@{B}v1.3 & v2+@{UB})

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Files" "Part 8 - The DIR Command - The FILES Option"

@{B}@{U}The FILES Option@{UB}@{UU} (NOT available in @{B}v1.2@{UB} in either form)

If you wish to view ONLY the names of the FILES within the directory then
you can use one of:-

  > DIR FILES   (@{B}v1.3 & v2+@{UB})
  > DIR OPT F   (@{B}v2+ only@{UB})

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Inter" "Part 8 - The DIR Command - The INTER Option"

@{B}@{U}The INTER (Interactive) Option@{UB}@{UU}

The interactive option or mode can be used as follows:-

  > DIR OPT I   (@{B}v1.2 onwards@{UB})
  > DIR INTER   (@{B}v1.3 onwards@{UB})

When this mode is used the system stops after each directory or file name
and displays a question mark after it. The user can then interact with
the DIR command by entering one of the following (upper or lower case
is accepted):-

   Return key only - go to next name in list

  E   - Enter the directory (Ignored for file names)
  B   - Go back up one level of directory tree. If in first directory then
        the command is quit.
  Q   - Quit the command
  DEL - Deletes the file or the empty directory currently being named
        (NOT the DEL key but the letters D E L)
  T   - Type the contents of the file on screen.
  C   - (Not available in v1.2)
      - allows the entry of an AmigaDOS  command.

This option is rather difficult to use and get used to. Personally, I
would rather use a good @{"directory utility" LINK "ADB:Misc/Glossary/DirUtility"} program.

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "AI" "Part 8 - The DIR Command - The AI Option"

@{B}@{U}The AI (All - Interactive) Option@{UB}@{UU}

The AI option is really a combination of the @{"ALL" LINK "All"} and the @{"INTER" LINK "Inter"} options.

It works in the same way as @{"INTER" LINK "Inter"} but shows the contents of all
subdirectories as well as the main directory.

  > DIR OPT AI      (@{B}v1.2 onwards@{UB})
  > DIR ALL INTER   (@{B}v1.3 onwards@{UB})

@{JCENTER}=== End of Text ===
@{JLEFT}

@ENDNODE

