@DATABASE "ADB05"
@INDEX "ADB:Misc/Index.Text/Main"
@HELP "ADB:Misc/Help/Main"
@NODE Main "AmigaDOS For Beginners - Part 5 - Commands & Keywords"

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

BY FRANK BUNTON

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

@{B}@{U}@{JCENTER}PART 5 - COMMANDS AND KEYWORDS@{UB}@{UU}

@{" Command Format & Template  " LINK "Format"}
@{" Commands                   " LINK "Commands"}
@{" Where Commands are Located " LINK "Where"}
@{" Command Keywords           " LINK "Keywords"}
@{" Command Options            " LINK "Options"}
@{" About Command Explanations " LINK "About"}

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

@NODE "Format" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - Format & Template"

@{B}@{U}COMMAND FORMAT AND TEMPLATE@{UB}@{UU}

Many texts, including the AmigaDOS manual, talk about the
@{"`Format' or `Template'" LINK "ADB:Misc/Glossary/Format"}. They will show things like the following
(don't worry - you do NOT have to learn this! But if you want to read more
about it then click on the highlighted area above):-

  DIR Format:-

  DIR [<name>] [OPT A|I|AI|D] [ALL] [DIRS] [INTER] [FILES]

  DIR Template:-

  DIR "NAME,OPT/K,ALL/S,DIR/S,INTER/S,FILES/S"

If you see this sort of thing do you:-

a) Throw up your hands in despair, tear up your Amiga manual and throw
   your Amiga in the garbage?

b) Give up on Shell/CLI altogether and go back to using Workbench only?

c) Read on?

If you chose (a) then please go back to the garbage, retrieve your Amiga
and give me a phone call to come and pick it up!

Give yourself a mintie if you chose (c)!

@{"Don't forget" LINK "ADB:Parts_01-10/04.Using_Shell-CLI/Template"} that you can examine the command template at any time by
entering:-

  > CommandName ?

@{B}@{U}FORGET ALL ABOUT FORMATS AND TEMPLATES FOR THE TIME BEING!!@{UB}@{UU}

My advice to you is to forget all about command formats and templates
for the time being. But @{"click here" LINK "ADB:Parts_61-70/63.FORMAT_&_TEMPLATE/MAIN"} if you really want to know more about
them. It is much better to learn the basics of a command without all its
fancy options. After you have been using them for a while is the time
to start looking at formats etc.

This series of articles is aimed at the raw beginner to CLI/Shell and
so will take the reader through various aspects in the simplest possible
way.

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

@NODE "Commands" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - Commands"

@{B}@{U}COMMANDS@{UB}@{UU}

A @{B}command@{UB} is one of the many "programs" that help you to operate AmigaDOS
such as DIR, CD, etc. I say "programs" as that is what they really are
- small programs that do a specific thing like DIR which reads the contents
of a directory, or CD to change the current directory.

There are about 82 AmigaDOS commands in AmigaDOS v2.1 (the last version
for which Amiga or Escom included an AmigaDOS manual). Earlier versions had
less and later versions have more.

However, a lot of these you will never use! You should not let the large
number of commands worry you at this stage. Many people use just a handful
of the total number of commands and get along quite happily without
learning the rest.

In the manuals you will find that, in the early days, the command
explanations contained only those commands that could be found in the "C"
(for "Command") directory and maybe one or two others such as DiskCopy and
Format that somehow found their way into the "System" directory.

The latest versions of the AmigaDOS manual tend to include, all in the
one section, a lot of other programs that I would not have thought were
commands as such. For example, they include the v2+ commodity and
preference setting programs and the text editor programs.

These articles will not cover programs such as these which I do not
consider to be commands in the old sense of the term.

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

@NODE "Where" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - Where Commands are Kept"

@{B}@{U}WHERE ARE THE AMIGADOS COMMANDS LOCATED?@{UB}@{UU}

In @{B}V1.3 and earlier,@{UB} commands are all contained in one of the Workbench
disk's directories. This is, in most cases, the "C" (for "Command")
directory. However, a few are in the "System" directory. Whichever
directory they are in, they are all DISK BASED.

In @{B}V2.0 onwards@{UB} there a two types of AmigaDOS commands:-

      INTERNAL and DISK-BASED

The "Internal" commands have been taken from the Workbench disk and hard
coded into the @{"ROM" LINK "ADB:Misc/Glossary/RAM-ROM-Rom"} chips. This means that you cannot find them in the
"C" directory any more. The "Disk-Based" commands are still in the "C"
or "System"  directories.

Having "Internal" commands has two advantages.

Firstly, the system can access them a lot quicker than disk based commands
- they don't have to be loaded from disk every time they are used. However,
disk based commands can be made @{"resident" LINK "ADB:Parts_21-30/24.Resident/What"} which means they are loaded from
disk into memory and then used from memory rather than from disk. However,
they are lost from memory again on power down or reset.

Secondly, a lot of disk space is saved.

To see a full list of all commands that are "Internal" simply enter at
the CLI prompt (don't type the ">" as that IS the prompt!):-

  > RESIDENT

This will display a list of all commands that have been made resident
followed by a list (if you have @{B}v2+@{UB}) of all "Internal" commands.

To see if an individual command is "Internal" or "Disk-Based" you use
the @{"WHICH" LINK "ADB:Parts_31-40/36.Which/Main"} command. For example:-

  > WHICH commandname

If it is an "Internal" command you will see:-

  INTERNAL commandname

If it disk based, you will see one of:-

  Dirname/commandname
  RES commandname

For example:-

  Workbench2.0:C/type
  RES copy

The first tells you which directory holds the command (if it has not been
made resident) and the second tells you that the command is disk based
but has been made resident.

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

@NODE "Keywords" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - Command Keywords"

@{B}@{U}COMMAND KEYWORDS@{UB}@{UU}

Some commands have @{B}Keywords@{UB} associated with them which give the command
some information about the way that the command should operate. For
example:-

  COPY FROM s:startup-sequence TO df1:s/startup-sequence

The command COPY uses the keywords FROM and TO to tell AmigaDOS that the
@{"string" LINK "ADB:Misc/Glossary/Strings"} following FROM is the file that is to be copied and the string
following TO is the directory that the copied file is to be put into and
name that it is to be given.

These strings, i.e. the information that is inserted by the user, are
also called @{"Arguments." LINK "ADB:Misc/Glossary/Arguments"}

Keywords often do not need to be used. If you used:-

  COPY s:startup-sequence df1:s/startup-sequence

AmigaDOS will know that the first string is in the FROM position and that
the second is in the TO position and act accordingly.

In other cases, such as:-

  FORMAT DRIVE df0: NAME mydisk

the keywords @{B}must@{UB} be used.

The command explanations will make it clear whether the use of the keyword
is optional or essential.

@{B}@{U}When Keywords MUST Be Used@{UB}@{UU}

Apart from those commands which state that keywords @{B}must@{UB} be included,
there are occasions when keywords must be used even if it is stated that
their use is optional.

I said above above that often the keywords do not need to be used as the
system will know what to do from the @{B}position@{UB} that the arguments are in.

However, where, for some reason, you wanted to put the arguments in places
within the command line that the system would not normally expect to find
them, then you @{B}must@{UB} include the keywords. For example, in the COPY command,
if you used:-

  COPY Disk1:File1 Disk2:File2

then the system would know that you wanted to:-

  COPY @{B}FROM @{UB}Disk1:File1 @{B}TO @{UB}Disk2:File2

If you wanted to reverse the position of the FROM and TO files then you
@{B}must@{UB} include the FROM and TO keywords as in:-

  COPY @{B}TO @{UB}Disk2:File2 @{B}FROM @{UB}Disk1:File1

The other situation where problems can arise if a keyword is left out
is if the argument is identical to a keyword. For example, let's say there
is a file that is called "From". If you tried to copy this file by using:-

  COPY from df1:myfile

then the system would think that the "from" was the keyword and that the
"df1:myfile" was the @{B}FROM @{UB}file. It would then find that there was no @{B}TO @{UB}
file and would give an error message.

You can overcome this sort of thing by either using the keywords, as in:-

  COPY @{B}FROM @{UB}from @{B}TO @{UB}df1:myfile

or by enclosing the name in inverted commas, as in:-

  COPY "from" df1:myfile

or by using the path to the file. For example:-

  COPY diskName:DirectoryName/from df1:myfile

So @{B}no matter which command you are using@{UB} just keep in mind that it is
best to use keywords in these situations:-

1. If the @{B}arguments@{UB} are not in the correct @{B}positions.@{UB}

2. If an @{B}argument@{UB} is the same as a @{B}keyword.@{UB}

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

@NODE "Options" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - Command Options"

@{B}@{U}COMMAND OPTIONS@{UB}@{UU}

A lot of CLI commands have "options" that can be entered along with the
command. They allow the command to operate in a slightly different way
to that in which the command would work without the options.

As an example, the COPY command has an option called CLONE which can be
used as follows:-

  COPY s:startup-sequence df1:s/startup-sequence CLONE

When COPY is used @{B}without@{UB} this option, then the system will write to disk
the date and time that the new copy was created. If CLONE @{B}is@{UB} used then
the date and time (and other things) of the original file will be written
to disk with the new copy.

Some commands have a lot of very complicated options, many of which most
people never use or understand.

As I discuss each command I will attempt to explain the way each of its
options works by giving examples. However, If you are a beginner and can't
understand a particular option then forget about it. Use only the simple
form of the command until you are more used to AmigaDOS commands. Then
maybe you can reread about the options again and it may be clearer.

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

@NODE "About" "AmigaDOS For Beginners - Part 5 - Commands & Keywords - About command Explanations"

@{B}@{U}ABOUT THE COMMAND EXPLANATIONS@{UB}@{UU}

As mentioned earlier, these notes are NOT a detailed explanation of the
full command format or template. Rather, they are designed to help get
the beginner underway.

I would suggest that you follow them through in their correct order as
some later articles will assume that you have already learned what is
in earlier articles.

The AmigaDOS @{"commands" LINK "Commands"} and their @{"keywords" LINK "Keywords"} are shown in UPPER case in order
to make them stand out. However, they need not be used by you in upper
case. AmigaDOS will accept them in any case, upper, lower or mixed. All
of the following will do the same thing:-

  > DIR df1: OPT A
  > Dir df1: Opt A
  > dir df1: opt a
  > DiR df1: OpT a

With the commands and their keywords shown in upper case, the additional
information, or @{"arguments" LINK "ADB:Misc/Glossary/Arguments"} inserted by the you, the user, are shown in
lower case. Thus in:-

  > COPY FROM name TO name

you will know that the words "COPY", "FROM" and "TO" are the AmigaDOS
@{B}commands@{UB} and @{B}keywords@{UB} and the two instances of "name" represent an
indication of the @{B}arguments@{UB} that you, the user, should put in that spot.

For example, you could use one of these:-

  > COPY FROM s:startup-sequence TO df1:s/startup-sequence
  > COPY FROM devs:Printers/EpsonQ TO df1:devs/printers/

As with keywords, the use of upper and lower case does not matter with
your own entries when you are reading from directory and file names.
AmigaDOS will see the names as the same even if the case is different.
However, when writing to a disk, AmigaDOS will write the name in the same
case that you use.

As there are some differences in commands from one version of AmigaDOS
to another, I will make a note with each command as to the differences,
if any. V1.1 is NOT covered as I do not have it nor have I ever seen it and
I would be very surprised if there is anyone still using it!

I will also make a note as to the location of each command so that you
can look for it on the Workbench disk if you so desire.

When I give examples, I will show them as in this example:-

  > DIR df1: OPT A

As mentioned early, the ">" is part or all of the @{"Shell/CLI prompt" LINK "ADB:Parts_01-10/04.Using_Shell-CLI/Prompt"}.
Do NOT type in the ">". Start typing the text that appears after the ">".

I will not say so in the examples but you must always @{B}press the RETURN
key@{UB} after you have finished typing. This tells the system that you have
finished your work and it is the computer's turn to do something!

If you @{"make corrections" LINK "ADB:Parts_01-10/04.Using_Shell-CLI/EditingNew"} to the start or middle of the line before pressing
return, you @{B}do not@{UB} need to return the cursor to the end of the line. You
can press return with the cursor @{B}anywhere@{UB} on the line.

If I show what should appear in the CLI window after the use of a command
then I will show it under the command and indicate it with "-->". Of course,
you will not see the "-->" in the CLI window!. For example, if I have:-

  > LIST c:dir
  --> dir 3440 --parwed 04-Dec-92 15:00:00

it means that everything AFTER the "-->" will appear on the screen when
you use the command shown after the prompt ">".

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

@ENDNODE

