AMIGA DOS COMMAND REFERENCE SUMMARY Produced by Joe Kaisler, The AMIGA Group, Greenbelt, Maryland. November 1, 1985 Warning: The following material has been gleaned from various conversations on Compuserve, BIX, Viewtron, and Delphi, and through cursory skimming of the AMIGADOS Technical Reference Manual, AMIGADOS Lattice C Manual, AMIGADOS Developers Guide. I do not have access to the AMIGADOS Users Manual. The information contained herein is guesswork and trial and error on an AMIGA System. It is not complete by any means, but is a helpful start for those who have no access to the manuals. I am not liable for anything misinformation in this article might cause, any lost files, etc. Take everything herein with a grain of salt. Hope this helps. Thanks to Very D. and Lance Rutallie for their upload of the original CMDTEMP.DOC which gave me insight to some commands I had not tried. CLI Command Summary Contents 1.0 File System. 1.1 Devices. 1.2 Files. 1.3 Directory. 1.4 CLI. 1.5 Pattern Mat. 2.0 DOS Commands. 2.1 ASSIGN. 2.2 BREAK. 2.3 CD. 2.4 COPY. 2.5 DATE. 2.6 DELETE. 2.7 DIR. 2.8 DISKCOPY. 2.9 ECHO. 2.10 ED. 2.11 EDIT. 2.12 ENDCLI. 2.13 EXECUTE. 2.14 FAILAT. 2.15 FAULT. 2.16 FILENOTE. 2.17 FORMAT. 2.18 IF. 2.19 INFO. 2.20 INSTALL. 2.21 JOIN. 2.22 LAB. 2.23 LIST. 2.24 MAKEDIR. 2.25 NEWCLI. 2.26 PROMPT. 2.27 PROTECT. 2.28 QUIT. 2.29 RELABEL. 2.30 RENAME. 2.31 RUN. 2.32 SEARCH. 2.33 SKIP. 2.34 SORT. 2.35 STACK. 2.36 STATUS. 2.37 TYPE. 2.38 WAIT. 2.39 WHY. 3.0 Script Files. 3.1 Invocation & Arguments. 3.2 Ex Scpt File. 3.4 Spec Scpt File 4.0 Command Summ. 4.1 Disk Cmds. 4.2 File Commands. 4.3 System Cmds. 4.4 Script Cmds. 5.0 File Naming Conventions. CLI COMMAND SUMMARY 1.0 File System Below is some explanations of what are files and devices on the AMIGA. This is not a complete list and not a quote from the DOS Manual. This is from experience in using the system and guesswork. Please do not take the following information as absolute truth, I can be wrong. 1.1 Devices There are various devices on the system the user should be aware of. The Console or Screen, which has two names. CON: for buffered IO, and; RAW: for non-buffered IO. The DISK drives are; DF0: (internal drive), DF1: (external drive) RAM: refers to RAM memory which acts just like a disk drive in terms of file manipulation. SER: addresses Serial port, which is not totally functional under DOS 1.0. PRT: for the Printer/Parallel port. NIL: for the Null/Nil device to act as a trashcan for the system. This is just an overview of the various devices and their names. There is probably a lot more that could be said, but I can't figure out what without proper manuals. 1.2 Files The names of files/disk names can be up to 30 characters in length and may include all normal printing ASCII characters except "/" and ":". Blanks are allowed only if the filename is enclosed in double quotes: "File with blanks". Examples of files are: ie. this.is.a.file So-is-this_a$file This!too@is#a(file Filenames can be typed in a mixture of upper/lowercase/symbols. What ever way you type the name of the file is the way the name will appear to you and DOS. It is irrelevant to DOS. DOS converts all lower case letters to uppercase when searching for files in the devices. This means that if I created a file "THIS.is.MY.file", then referencing by "this.is.my.FILE" is ok, DOS will find it. A filename always refers to the current directory unless a directory path is specified (see Path section, next one). 1.3 Directories Files can be hierarchially organized on some devices (DISK and RAM). This organization is called directories. A directory is a file that points to other files or directories. A path is the definition of the file found on a disk or in RAM. It is the concatenation of device name and directory/subdirectory names. An example would be, if the Workbench disk is in drive df0:, and the directory containing the DOS commands is c, then the path is: DF0:c Another example is the device directory, 'devs' on the Workbench disk. In it there is a directory called 'printers'. In this directory is a file called 'epson'. So to reference the file, we give the full path qualifier: 'df0:devs/printers/epson'. This tells DOS to go to device 'df0:', find the directory 'devs', in that directory find the directory 'printers', and then find the file 'epson'. Directories can be stacked/layered as deep as desired. The highest directory on a disk is specified as ":" or for the current device, just ":". On the workbench disk, directory 'fonts' is specified as ':fonts'. A directory inside it might be, ':fonts/sapphire'. We do not have to give the file name, if we want to use just the directory path. For example: 'df0:devs/printers' refers to the whole directory and not any particular file within it. To go up levels is easy, just type CD /, the slash says go to the parent of the directory we are at. So if we were at 'df0:fonts/sapphire', that is, in this directory, by typing 'CD /', we would be up at 'df0:fonts'. We can use the '/' to refer to directories above us and down in the tree structure. Remember that ":" always refers to the TOP/ROOT directory of the current device. EXAMPLE OF TREE STRUCTURE Lev 0 ROOT (DF0: DF1: RAM:) I I---------------------------- I I I I I Lev 1 DIR1 DIR2 DIR3 FILE1 FILE2 I I I I I I I------ I ----------- I I I------ I I I I I I I I Lev 2 DIR4 DIR5 FILE3 FILE4 FILE5 FILE6 I I I I I I I I-------- I I I------- I-------------- I I I I I Lev 3 DIR6 FILE7 DIR7 FILE8 FILE9 I I I I I------ I-------------- I I I I I I I I I I Lev 4 DIR8 FILE10 FILE11 FILE12 FILE1 CLI is the Command Language Interpreter for DOS. It has the form of accepting lines of input as: cmd arguments=(arg1 arg2 arg3 ...) Arguments are optional on some commands and required on others. Some commands require special keywords and switches. See section 2.0 for more. Some characters have certain implications to DOS: CTRL-C System Interrupt CTRL-H Backspace(BACKSPACE KEY) CTRL-L Clear the Screen CTRL-X Delete current line < Take input from named dev/file ie. cmd redirect the flow of output to named file or device. ie. cmd >file - will send output of 'cmd' to 'file' ; text text text The semicolon on any line says that the anything after the semicolon is a comment and to ignore it. 1.5 Pattern Matching Pattern Matching on files follows: ? matches any single character. % matches the null string. #

matches zero or more occurences of pattern p. (one or more chars) matches pattern 1 followed by pattern 2. l matches if either p1 or p2 matches. ( ) groups patterns together. EXAMPLES: A#BC --- matches AC, ABC, ABBC, etc. A?C --- matches AAC, ABC, A!C, etc. A#?B --- matches AB, AXXB, AZXQ&+B, etc. A(Bl%)#C --- matches A, ABCCCC, ABC, etc. but not ABBC. (Bl%) says one B or no B then C. So ABBC is invalid. 2.0 DOS Commands DOS Commands are of the form: Command arguments. Arguments can be filenames, keys or switches or text or strings. To find out what are the arguments available for any command, just type: cmd ?. This will prompt you with the arguments available for that particular command. You will find that there are some funny conventions used in the arguments. Arguments will be followed by a '/A' and/or a '/K' or a '/S'. These two strings specify if the argument is either a KEYWORD or a SWITCH. They are basically the same, except that SWITCHes must be given, while KEYWORDs are optional. If the KEYWORD is optional than it will be followed by A. If the KEYWORD is required than it will be followed by K. Finally, if a KEYWORD is a SWITCH and requires no further info ("argument"), it will, be followed by /S. 2.1 ASSIGN ASSIGN NAME,DIR,LIST/S Assigns a new name to a device. Device Names are defined in the section dealing with devices. Examples are SYS:, RAM:, DF0:, SER:, etc. ie. assign c: ram:c - Gives the system name c to the device ram:, sub-directory c ie. assign - Tells what assignments have been done for the system and the various devices currently available to the user. 2.2 BREAK BREAK task/a,all/s,c/s,d/s,e/s,f/s. Sets some stop flags, such as Control/C and Control/D, etc. 2.3 CD CD directory. Changes the current working directory. It also changes the current drive. ie. cd df1: - changes the current dir. and drive to df1: drive, root dir. ie. cd :devs/printers - changes the current directory from wherever we were to the current drive ':', directory 'devs', and in it, sub-dir. 'printers'. ie. cd //tools - changes the current directory from wherever we are, up two levels in the directory tree '//' and to a sub-directory there called 'tools'. NOTE: See the section talking about directories. 2.4 COPY COPY FROM,TO/A,ALL/S,QUIET/S ie. copy Copies the contents of to . and must be either files, directories, or disk name. For example: copy df0: df1: all - will copy all the files of the drive df0: to the drive df1: including all directories and files that are contained therein. copy df0:c/dir ram:c copies the file 'dir' from the directory 'c' on the drive 'df0:' to a file of the same name in directory 'c' on drive 'ram:'. Pattern Matching can be used to copy a select group of files. 2.5 DATE DATE TIME,DATE, TO=VER/K Allows you to set the current date and time for the system clock. As the AMIGA does not have a battery backup, this will have to be done every time it is turned on. Date has the form dd-mmm-yy, where dd has to be two digits corresponding to the day of the month, ie. 05 for the fifth, 22 for the 22nd, etc. Time has the form hh:mm:ss, where hh is hours by military time, mm is minutes, ss are seconds. If ss is omitted, defaults to 00. Can also give a day of the week, like Tuesday, Wednesday, etc. See section on maintaining the Clock. Sorry, don't know what TO=VER means. 2.6 DELETE DELETE ALL/S,QUIET/S ie. delete If is a filename, then the file is deleted if the protection for it is allowed. If is a directory name, it will delete the directory only if no files exist for the directory. Upto 10 filenames can be given on the delete command line, unless pattern matching is used. Then all the files matching the pattern will be deleted. You can delete a directory and all the files in the directory by giving the ALL parameter after the name of the directory. ie. delete df0:c all - deletes all the files in the directory c on the drive df0: and then deletes the directory itself. 2.7 DIR DIR DIR,OPT/K - The DIR command will give a directory of files associated with a PATH qualifier. If no path qualifier is given, the current directory is used. DIR gives at first a single column of files that are directories (if any exist), then it gives a 2 column format of filenames also. To follow the tree structure of directories, give OPT A, which specifies display all files and directories. To show only those files that are directories, give OPT D. To interactively parse the tree structure of directories, use OPT I. It will display file or directory names with a "?" after it, you type one of the following: RETURN goes to the next file or directory Q quits the interactive parse. B goes back a level (up to the next higher level) or quits if you're at the root(":"). E Enter directory D Delete file or directory (if empty) T Type file to the screen CTRL-C stops typing and continues interactive mode. 2.8 DISKCOPY DISKCOPY From/a,To/a/k,Name/k Copies a disk to another disk. It behaves just like the disk copy from the Workbench Menu Line. 2.9 ECHO ECHO "text" Display the 'text' to the console in the window that it was invoked in. Primarily used to give information to the user about the status of the execution (EXECUTE) of some background job. Note: the double quotes around the text are mandatory, unless the text has no imbedded blanks or special characters. 2.10 ED ED FROM/A,SIZE Opens the full screen editor on the file . The commands given elsewhere in this packet are the ones controlling its use. Sorry, do not know what SIZE does yet. 2.11 EDIT EDIT FROM/A,TO,WITH/K,VER/K,OPT/K The Line Oriented Editor. Sorry, but have not defined the commands for it yet. Waiting for a DOS manual to find them out. 2.12 ENDCLI ENDCLI Ends the current invocation of CLI. This is the same as hitting the DOT box on a window. Warning: If you have not loaded in Workbench, and the current invocation of CLI is the only one, you will be forced to reboot the system. 2.13 EXECUTE EXECUTE args Executes a script (text) file containing various AMIGADOS commands and program invocations. See the section on Script files. 2.14 FAILAT FAILAT arg Resets the error level needed to crash a sequence. 10 is normal, 5 is lower, 25 is higher. Useful running background, especially with IF command. Sorry, I don't understand error levels. Examples range from 5 to 100. 2.15 FAULT FAULT When a system error has occurred, it gives you a number. Fault will take that number and turn it into meaningful (?) text. ie. fault 222 - gives Fault 222: file is protected from deletion. You tried to delete a file that had its Deletion protection removed. 2.16 FILENOTE FILENOTE FILE/A,COMMENT/A Adds a line of text/comment (up to 80 chars) to the filename given. The comment must be enclosed in double quotes. Use the LIST command to see the text associated with the file. ie. filenote dir "The command to give a directory listing" 2.17 FORMAT FORMAT DRIVE/A/K,NAME/A/K When preparing to use a new disk or to fix an old disk, you must FORMAT it. The command must be given with all parameters as such: ie. FORMAT DRIVE df0: NAME "Workbench copy" This will format the disk in drive df0: (could be df1: also) and give it the name "Workbench copy". Remember, disk and file names are no longer than 30 characters. 2.18 IF IFNOT/S,WARN/S,ERROR/S,FAIL/S,,EQ/K,EXISTS/K Allowed only in Script files. Primarily used to test boolean expressions. See section on Script files. 2.19 INFO INFO Gives info about all disks mounted in the system and the ram drive as well. Tells how much storage on the device, how many blocks used, how many blocks available, how many errors recorded for the device, Name given the device. Also, tells which disks have been used in by the system. 2.20 INSTALL INSTALL DRIVE/A Makes a disk bootable. I.E. put it in the drive, hold down control/AMIGA/AMIGA keys and you'll wind up in CLI. 2.21 JOIN JOIN ,,,,,,,AS/A/K Join ... as Takes all input files in succession and concatenates them together to give the file . ie. JOIN data1 data2 data3 AS total.data. ECWarning: ED the file named as can not be one of the input files, or it will result in empty file. DOS will empty the file before reading any file as input. You may give upto 10 files as input to JOIN. 2.22 LAB LAB label Used in Script files to give a LABEL to a particular spot in the file. Used with the SKIP command for program control jumps. See the section on Script files. 2.23 LIST LISTDIR,P=PAT/K,KEYS/S,DATE S/S,NODATES/S,TO/K,S/K,SINCE/K, UPTO/K, QUICK/K This command gives detailed information about the file. It provides the user with the name of the file or directory, size(in chars) if it is a file, protection, date and time last modified, and the comment field from the FILENOTE (if given). You can use Pattern Matching, NODATES, SINCE, UPTO, QUICK to select different files depending on the option given. QUICK gives a single column of the file names as they appear on the disk, without any other description, like whether it is a file or dir, size, etc. SINCE/UPTO allow you to specify files selected by their date, SINCE dd-mmm-yy, will select files since that date, and UPTO selects upto that date. If no file names or directory names are given, LIST defaults to the current directory or path. You can specify a different path by giving it as the first argument: ie. LIST df1:examples/include - This gives a detailed listing of the files in the directory include or if it is a file, the file include in the directory examples on the drive/device df1:. 2.24 MAKEDIR MAKEDIR /A ie. makedir tools Creates a new directory called tools wherever the current path is pointing to. At the time of creation, the new directory will be totally empty. You can specify to create a directory other than were you are at by giving a full path prefix before the name of the directory. ie. makedir df1:examples/tools - This will make a directory called 'tools' in the directory 'examples' on drive 'df1:'. 2.25 NEWCLI NEWCLI Opens a second invocation of CLI for the user. At the time it is open, the new CLI becomes the active window. 2.26 PROMPT PROMPT "prompt" Instead of having the '1>' prompt, the user can change the prompt to whatever he/she wants. ie. prompt "$ " - will change the prompt to look like UNIX ie. prompt "A>" - will change it to look like MSDOS/CPM. 2.27 PROTECT PROTECT FILE/A,FLAGS Changes read/execute/write/delete status of an existing file. Change the IO capabilities of a file or directory. The flags are R for READ, W for WRITE, E for EXECUTE, D for DELETE. They are given in any combination and specify what DOS can do to the file. Protect data.file r - Set the file to read only, now DOS can not write to, execute or delete the file. Any mixture of R, W, E, D can be used at any time. 2.28 QUIT QUIT number Terminates the current EXECUTION of a Script file. The number is a returnd code to give back to the caller who (whom?) invoked (EXECUTE) the script file. The number can be optional and is user defined. See the section on Script files. 2.29 RELABEL RELABEL DRIVE/A,NAME/A Changes the name of a disk already in use. If you do not like the name of a disk and don't want to reFORMAT it, use RELABEL to change the DISK name. ie. RELABEL DF1: "New DISK NAME" - Note: the name of the disk is now called 'New DISK NAME' with the imbedded blanks. 2.30 RENAME RENAME FROM/A,TO=AS/A Allows the user to change the name of the file, or to move the file from one directory to another, BOTH without a copy/delete sequence. ie. rename myfile yourfile - renames a file called 'myfile' to its new name 'yourfile'. You can also move a file from one directory to another by specifying the full path names of the file. ie. rename :c/dir t/dir - renames the file 'dir' in directory c on the current disk to a file called 'dir' in the t directory on the same disk. Note: You can not rename/move a file from one disk to another, it must be copied. 2.31 RUN RUN commands Runs various DOS and user program commands in the background (ie. another CLI window). ie. RUN myprogram - runs my program in background. ie. RUN myprogram + - runs 'myprogram' in background, yourprog + then run the program 'yourprog' info then run the DOS command 'info' 2.32 SEARCH SEARCH FROM,SEARCH/A,ALL/S Looks through all the files in a directory for the string argument (upper/lower case are equivalent). To abandon command, Control/C; to abandon current file and go to next, Control/D. Displays filename and line of any match. Search the given file for all occurrences of the string , giving line number and line. 2.33 SKIP SKIP label Jumps to a line in a Script file with a LAB command followed by the 'label'. The LAB command must be after the SKIP command, this is due to the sequential nature of Script file commands. Primarily used inside the IF ELSE ENDIF construct. Please see the section on Script files. 2.34 SORT SORT from/a, to/a, colstart/k Sorts files by first character of nines, or by character at column specified. AMIGA crashes if sort is too large and stack is too small. Reset stack-size upwards with stack command if file has more than 200 lines. Sort the input file to output file starting in column (colstart) . Only allows one level of sorting. 2.35 STACK STACK size Displays or sets size of AMIGADOS stack. Initial value is 3200. ABasiC needs 8000 or so to run as a command. Sort can require substantial stack space. 2.36 STATUS STATUS PROCESS,FULL/S,TCB/S,SEGS/S,CLI=ALL/S Gives a running status of all jobs being executed by the AMIGA that the user started. This includes any open CLI windows, any jobs RUNning in the background mode, any programs the user has invoked. 2.37 TYPE TYPE FROM/A, TO, OPT/K Types a file to another file or a device. ie. Type - will type the file to the screen. Giving the argument opt followed by N or H changes the characteristics. Option N means preface lines of text with line numbers. Option H means display each character in hex format then in ASCII. Can be used to send files to various devices, like the printer: Type to PRT:. 2.38 WAIT WAIT SEC=SECS/,MIN=MINS/S,UNTIL/K Waits a specific number of seconds or minutes or until a specified time. 2.39 WHY WHY Explains why a previous command failed. Can't open file FRED could mean it [FRED file] exists, insufficient disk space etc. WHY and FAULT are useful together. 3.0 Script Files Script files are files of executable commands lines and control constructs. The way a Script file is organized is like a high level programming language. Basically, the user can set conditions in the system and execute various sequences of commands depending on the conditions. Some of the constructs we use in a Script file are: IF ELSE ENDIF QUIT EXECUTE RUN ECHO Other DOS Cmds. SKIP User Programs LAB . (DOT) Cmds. 3.1 Invocation and Arguments Invoking a Script file is by the EXECUTE command: The command line to invoke a file is as follows: EXECUTE file arg1 arg2 arg3... The first parameter to the EXECUTE command is the name of the Script file. The rest of the parameters are arguments or parameters to the Script file itself. All these arguments must be separated by blanks. If an argument has to have imbedded blanks, enclose the argument in double quotes: " this is a compound argument". ie. EXECUTE user.scr Total Next Last 45. What we are saying is to go EXECUTE or process the commands found in the file 'user.scr'. When we do this, make available to the file the arguments listed on the command line 'Total', 'Next', 'Last', '45'. To access the arguments in the Script file, we use the following .(DOT) command: .KEY arg1, arg2, arg3, arg4. This tells the EXECUTE program that we are expecting 4 arguments called arg1, arg2, arg3, arg4. We could use any name we wanted for each argument: .KEY First, Top, last, number. But it is nice to use names which mean something to us and how the arguments are passed, ie. arg1, arg2, arg3. In the example above, arg1 or First would refer to 'Total', arg2 or Top would refer to 'Next', etc... in a sequential manner. That is how the arguments are referred, but how do we use them? Well we must enclose an argument name in delimiters. The default delimiters for a Script file are '<' and '>'. So to get the value for arg1, we would use: , for the value of arg2, , etc... . What if we do not like '<' '>', what do we do? Well, we can change the delimiters to be anything we want: .BRA [ .KET ] Now the delimiters are ']' and '['. We would then reference values by [arg1], [arg2]. 3.2 Example Script File ; This is an example Script file to show what one looks like ; It is meant to show the capabilities and functionality of ; the various actions that a Script file can do. ; ; Define the keys/arguments to this particular script file. ; .KEY arg1,arg2,arg3,arg4 ; ; Now start the various commands that we want to do. ; IF EXISTS .c ; Test if the file .c exists ECHO "File exists .c" ; If it does tell us SKIP label1 ; Jump and start at label1 ELSE ; File did not exist, control here ECHO "File does not exist .c" ; Tell us it does not exist SKIP label2 ; Jump and start at label2 ENDIF ; End of IF statement ; ; These actions below are for when a file exists ; LAB label1 ; CC -O -c .c ; Compile the C source file .c ALINK .o .lib ; Link together the two files ECHO "Finished Processing file .c" ; Give us a message SKIP END ; Jump to the end ; ; ; The actions below are if a file does not exist, ; error and return. ; LAB label2 ; ECHO "Error - The input C file .c" ; Tell us file was not there ECHO " does not exist, can not" ECHO " Compile files, Error Exit" QUIT 5 ; Exit with error code set. ; LAB END QUIT 0 ; No errors, return peacefully 3.4 Special Script File There is one special script file in the AMIGA. It is the file called 'startup-sequence' on the Workbench disk in directory s. This file is called/invoked/executed everytime the AMIGA is rebooted. This is the AUTOEXEC.BAT file to those with MSDOS backgrounds, or the '.profile' file to those with UNIX backgrounds. This name is hardcoded into the system. The user can define several commands in this file to orient the system to the particular needs of the user. For example, on my AMIGA, the system boots up, copies some DOS files to the RAM disk, reassigns the C: to RAM:, and sets my prompt to look like UNIX and then ends. It does not load Workbench in at all. This is the way I like it for now. I also have it ask me for the date, by specifying 'date ?'. This will stop the file execution till the user answers the prompt. The user could have this file call other files or programs through the EXECUTE and program name format. 4.0 Command Summary Below are categories of the DOS commands by what they act on. This is easy way to lump them together by type of actions they work on. 4.1 Disk Commands INFO DIR LIST RELABEL ASSIGN DISKCOPY BREAK CD INSTALL FORMAT MAKEDIR 4.2 File Commands COPY RENAME DELETE TYPE ED EDIT RUN SEARCH SORT JOIN FILENOTE PROTECT 4.3 System Commands FAULT FAILAT WHY NEWCLI ENDCLI STACK STATUS WAIT DATE PROMPT 4.4 Script Commands IF ELSE ENDIF ECHO SKIP LAB QUIT EXECUTE*cn1 5.0 File Naming Conventions The following are a list of recommended filename extensions for the AMIGA. These are just guesses at how to keep the identity of files distinct from one another. The form of using the file extensions is as follows: filename.ext - Where .EXT has the form specified below. .LIS - Listing file, can be directed to the printer. .DAT - A data file for a program. .DOC - A document file for various word processors. .TXT - A text file. .NAM - A name file for use in prompting a program. .SCR - A Script file. .DBF - Data used with any program, spreadsheet, etc. .GRF - A graphics dump, screen, etc. .SCN - A Screen Dump/Save. .ASM - An Assembler Source File. .BAS - A Basic Source file. .C - A C source file. .L - A Lisp source File. .F - A Fortran Source file. .P - A Pascal Source file. .O - An obj module compiled from source (C PASCAL ASM). .OBJ - An obj module compiled from source (C PASCAL ASM). .LIB - A library of routines for some package. .SRC - A Source file for Arrange. .SCH - A Schema file for Arrange. .MRG - A Merged Source/Schema file for Arrange.