30 November 1986 Amiga Society of NW Indiana AMIGA DOS (part 1) BY: Rick Ward Vice Honcho There comes a time in the life of every Amiga owner when they find that they have a need to do more with files and the system than it is possible or practical to do from Workbench. Fortunately there is an alternative, CLI. Like workbench, CLI is a way to communicate with Amiga DOS. Unlike Workbench you have all of the Amiga DOS commands at your disposal, and it is a much faster means of retrieving, copying, printing, sorting, altering, examining, and creating files on a Disk. Before we can get started with learning to use Amiga DOS, we must understand how the archive file structure works. You are already familiar with it, if you have been using workbench, but you may not realize it. When you first insert your workbench disk, and the little disk Icon Appears you click it, and the files and directories in the root(main) directory are displayed on the screen in the form of Icons. The files will be pictures of objects that describe the file. An example is the preferences file, it is represented by a picture of an Amiga. The drawers you see are actually directories and if you click a drawer you see files that are in those directories, and in many cases more directories (drawers). Now, lets look at the same things from CLI. When you enter the command DIR you see all the files that you saw on the workbench screen, plus some extra files and directories that you did not see. Look for the preferences file, you probably noticed that a file called preferences.info also exists. The .info file is the Icon you see when you use the workbench. This is why you see more files and directories here from CLI than you did from the workbench, some of the files do not have the .info following them. Now lets look for the System directory, remember what it looked like from workbench? Here you see system (dir). remember what you see if you click the system Icon from workbench? You see icons called diskcopy and CLI if you are using V1.1 workbench. Lets do the same thing here. Type [CD system] cd stands for current directory, and tells Amiga DOS that you want to work in that directory. Now type in dir (remember that one) now you see the diskcopy file and the diskcopy.info and CLI, and cli.info. Now that you understand how the Amiga Archive filing system works, it is time to move on. We have already touched on 2 of the most used AmigaDOS commands, DIR, and CD. You can use Upper case or lower case letters with Amiga DOS, it makes no difference. Now we will learn some new commands. I will try to discuss them, each one according to its importance, and frequency of use. Dir, is probably the most used DOS command. Lets discuss it bit more. You can examine the contents of a directory without making it the current Directory, by simply typing the name of the directory after dir. For example, If you are in the root directory and want to examine the contents of the C directory, which is where all AmigaDOS commands are kept, you could just type [dir c]. Suppose you want to inspect a dir. that is on a different disk, you could of course make it the current directory or just type dir and the the number of the drive. For example if you wanted to inspect the root dir of drive 1 which is the first external drive you would type [dir df1:] Device names are always followed by a colon. Now suppose you want to look at a directory that is not the root directory of the first external drive. Lets say you want to see a subdirectory. If we have a directory in the root directory of df1: called mydir, to inspect it you would type [dir df1:mydir]. After inspection you see in it another dir called mydir2. You want to see what is in mydir2 now you type [dir df1:mydir/mydir2]. The slash is used to specify directories or files within directories. Now lets look at another form of dir called the interactive mode. Type in [dir opt i] and push return. The first file or directory in the current dir. is listed and the Amiga waits. If you push return the next file or dir will then be shown. If you type [del] the file or directory will be deleted. (the directory will not be deleted unless it is empty). If you are at a directory you could type [e] and you will then enter that dir., and the first file or dir of it will be shown. To go back to the previous directory you would type [b] after all the files in that dir have been shown it will go back to the previous one. If you are at a file you can type [t] to type it to the screen. Another form of dir is dir opt a. The 'a' stands for all. [type dir opt a] and all the files in all the directories will be listed. That is very useful, but what if you want all the files to be listed to the printer, instead of the screen. Now we type [dir > prt: opt a]. The greater than sign tells DOS where to send the output. With AmigaDos you can select any device for output. But we will not go into that now. If you type [Dir opt d] only the directories will be listed. Ok time to learn a new command. remember all those files and directories? Suppose you decide you no longer need one of them. You can delete it from the disk by typing in [DELETE name] where name is the file or directory no longer wanted. You can specify a path just as you did with the DIR command. If the file name is Myfile, and it is in a directory named mydir, on the internal drive you could type [Delete df0:mydir/myfile]. If you decide that the entire directory should go, you could type [Delete df0:mydir all] if the directory is empty, you can leave out the all. A word of caution about using all. Any and all files and directories in the directory that you specify will be erased forever. Copy and diskcopy are 2 more often used command, You can use copy to copy files from one directory to another, or directories into other directories or even disks to other disks. This is not the same as the diskcopy. The diskcopy command does a sector copy of a disk copying even the sectors which are empty. With Diskcopy you don't need to format the disk first. Diskcopy formats as it goes, so it also deletes anything that was on the copy to disk. To get it out of the way, the format for diskcopy is [diskcopy from df0: to df1:] or for one drive systems from df0: to df0:. Ok now that we have diskcopy covered we will talk about copy. If we want to copy a file from the root directory of df0: to the the root directory of df1: we would type [copy myfile from df0: to df1:] we would use the same format for specifying the path that we used with the previous commands. To copy from the root dir of df0: to mydir on df0: we would type [copy df0:myfile to df0:mydir]. Now lets make a new directory on our disk. To do this we simply type in makedir path name. For example if we want to make a new directory named newdir in the mydir directory, we would type [makedir df0:mydir/newdir]. Now we have a new directory that we can copy files to or from, or add new files to. Type is another very useful command. It is used to inspect text files. The format would be type filename. For example if we have a file on the disk called prog.doc, and we wanted to read it, we would type [type prog.doc]. If we wanted to type it to the printer we would type [type prog.doc to prt:]. To stop the file from being typed before it is finished you would hold down the Ctrl key while pressing the 'c' key. Any Amiga dos command can be aborted using this sequence. We have 2 opt commands we can use with type, opt n, and opt h. Type opt n will give line numbers in front of each line typed. Opt h will print the file in Hex format. Now lets learn how to make a blank unformatted disk into one we could use as a CLI disk to replace the workbench disk. First take a brand new disk, be sure it is write enabled, and put it in df1:. Write protect your workbench disk, and put it in df0:. Type [Format df1: name "anyname"]. After the disk has been formatted, we will want to make it bootable. Type [install df1:]. Ok now we will use the Copy command to put the files we will need on the disk. We will need the C directory because that is where all of the AmigaDos commands are. First lets create the C directory on the new disk. Type [makedir df1:c]. Now type [copy df0:c to df1:c]. We now have a CLI disk. We will need a few more directories from the workbench disk. Copy the libs, l, devs, system, and fonts directories the same way you copied the C directory. Remember to make the directories first, and use the all option when copying devs as it has other directories within it. We now have a fully functional CLI disk that we can use instead of the workbench disk. Now type info at the cli prompt. Notice the how much more disk space you have on your cli disk than you had on your workbench disk. If you use the calculator supplied on the workbench disk you can copy it to the cli disk now. Just type [copy df0:calculator to df1:]. Now when you want to use it just type calculator at a CLI prompt. If you feel calculator is to long a word to type each time you want to use it, you can rename it. Type [rename df1:calculator as calc]. You can rename anything on the disk the same way. When we first formatted the disk, we named it anyname. Thats a dumb name for a disk. Lets change the name to CLIdisk. At the cli prompt type [relabel drive df1: name clidisk]. We sure have learned a lot of new commands in a short time, but lets go for a few more. We have our new cli disk in drive df1:, and the workbench disk in df0:. The Amiga is still looking for the DOS commands on the workbench disk, as that was the system disk in df0: when we booted the system. lets tell it to get the commands from the CLI disk instead. Type [assign C: clidisk:c]. now type [assign sys: clidisk:]. Assign devs and libs the same way. Now you can remove the workbench disk from df0:. It no longer has a purpose in life. You can now insert any disk you wish in df0: to do anything you wish. What we just did we did to learn the assign command. We could have just inserted the cli disk in drive df0: and did a warm start on the system. From now on if you want to use the Cli disk just insert in after kickstart when the hand holds up the workbench disk. We have covered some of the most used AmigaDos commands, We have left out a lot. From here on we will discuss briefly the RAM disk, and ED. A ram disk is simply an area of ram that will work just like df0: and df1:. With one exception. It is very fast. Lets copy our c dir to ram: and see how it works. Type [makedir ram:c]. Now type [copy df0:c ram:c]. Now type [assign c: ram:c]. Now when you type an AmigaDos command it will load it from the Ram disk instead of looking for it on the df0:. Type [info]. You now see the sectors used on df0:, df1:, and ram:. This is very useful to people who only have one drive as it saves a lot of disk swapping. If you have additional Ram you could copy the c directory into ram at startup, by adding the commands to the startup-sequence. The startup-sequence is in the s directory. The Amiga will look at this file for instruction to follow during startup. Lets make a startup-sequence on our CLI disk. First we will have to create the S directory. Type [makedir df0:s]. Now type [ed s/startup-sequence]. Type the following in, pushing return at the the mistake and retype it. You can use the delete key to delete the mistake. I will not tell you all of the ed commands, but I will supply a handout explaining them. Echo "copying c to ram:" makedir ram:c copy c: ram:c assign c: ram:c echo "finished making ram:c" Now press the esc key. You should see an astirisk in the corner. Press 'x' The startup-sequence is complete. To test it do a warm start now. What we just made was a batch file. You can create as many batch files as you like. In the same way, adding any AmigaDos commands that you want to add. To start executing a batch file you type [execute batchfile]. Where batch file is the name of the batch file you wish to execute. This is the last AmigaDos command I am going to discuss here. It is the Run command. When you type run before a command file a new CLI will be started, and the command will be run as a background task. This leaves you free to do what you want from the Cli you are in, while the command or program is running in the other CLI. For example if you have a large text file to print out, and you have other things to do, you type [run type textfile to prt:] While it is printing in the background you can copy delete, play a game, download a program from your favorite BBS, or all of the above. Aint Multi-tasking wonderful. Disclaimer: This Tutor is intended for the first time CLI user. It by no means covers all the AmigaDos commands, or even all the uses of the commands that are covered. It is not intended to replace the AmigaDos manual. I will not except any responsibility to loss or damage to software or hardware do to this tutorial. I am not a professional writer nor do I attempt to be one. This is not copy writed, and can be distributed as free and public domain. If it is used in a for profit publication, please send my share of the doe to Rick Ward 638 S. Washington st. Hobart, Indiana. 46342