Previous Next Chapter

Command Line Basics

Effectively using a Command Line Interface, such as the Amiga Shell, requires that you understand concepts unique to this method of working with your computer. These include:

Files, Programs, Commands, and Scripts

Files, programs, commands, and scripts are named collections of data that can be stored in the computer's memory or on a disk drive. These concepts can be confusing because the meanings of the terms often overlap.

Files

Programs, commands, and scripts are all files. Files can be stored on disk or in the Amiga's memory, although certain kinds of files are customarily stored in specific locations.

Programs

A program is a file that the computer executes to accomplish some task. Software that you buy for the Amiga are mostly programs. Workbench programs are called tools, utilities, or editors. A file that is not a program is typically a data file, which contains information a program can use, such as text or graphics. Programs can be stored anywhere.

Commands

A command is a type of program. The term command usually refers to programs that are executed through a command line such as the Shell, especially those programs that come with a computer as part of the operating system and perform some basic function. The programs detailed in Chapter 6 of this book are the AmigaDOS commands. AmigaDOS commands that are not Internal (built into the Shell) are stored in the C: directory.

The term command can also refer to a specific instance of that program's invocation, including its arguments, if any. In this manual, the term command line is used to indicate a command program's invocation; for example, "The command line TYPE S:User-startup is an example of the TYPE command." The command must always be the first thing on the command line.

Scripts

A script is another type of program that is a text file containing a series of commands comprising the program. You can view and edit a script with a text editor. A script typically performs some simple task than can be modified by editing the script.

In this manual, the term script refers to scripts of AmigaDOS commands. AmigaDOS scripts are customarily stored in the S: directory. ARexx programs are also called scripts, although they can the S: directory using the assignment REXX:. Some computer systems refer to scripts as batch files.

Search Path

When using the Shell, the Amiga must know where to look for the commands you want to use. The Shell has a search path, which allows you to enter commands without providing the full path. The search path is a series of directories that AmigaDOS searches to find commands that are entered without paths.

The default search path includes the current directory, C:, and several other directories specified in the standard Startup-sequence. You can add other directories in which you keep frequently-used programs by using the PATH command or by using multiple assignments with the ASSIGN command. There is, however, a significant difference between these two methods. Directories added to the search path with the PATH command are local to the Shell in which you added them and to any sub-Shells launched from that Shell. Directories added through multiple assignments with the ASSIGN command are global to the whole system.

When you enter something in the Shell, AmigaDOS looks through the directories in the search pth for a command of that name. It searches the directories in the order they appear in the path until it either finds the command or reaches the end of the path list. When a command cannot be found in any of the search path directories, the Shell displays an Unknown command message, as illustrated in Figure 3-2.

Figure 3-2. Search Path

Note:

Current Directory

The current directory is the Shell's current location in the filing system hierarchy, similar to the Workbench's current window. The name of the current directory is displayed in the default Shell prompt so that you always known where you are. The following properties apply to the current directory:

Changing the current directory, like adding directories to the search path, is a way to reduce the amount of typing necessary to specify a command. Often you need to perform several operations within a certain directory, such as copying, renaming, and deleting files. You can avoid entering the full path for each file by changing the current directory to that directory in which most of the files are located.

Top Previous Next Chapter