<!-- PDF page 183 -->

ticular file. **ERASE** offers you some form of protection if your *filespec* contains *wildcards* in the form of a question in which you will have to answer with a **Y** on the keyboard to continue or with **N** to stop, but offers no protection if you specify a single filename, which will immediately be erased from the drive – so exercise caution! If, for example, you wanted to delete a file from drive **m:** called **FRED.BAS**, you would use:

```
ERASE "m:fred.bas"
```

If drive **m:** has already been set as the *default drive* (by either using **SAVE**, **LOAD**… or even **CD**), then you don't need to include the **m:** at the start of the filename. It doesn't hurt to include the drive anyway, and with as powerful a command as **ERASE** is, you might feel safer if you do. To erase all the files on drive **d:** you would use:

```
ERASE "d:*.*"
```

Before doing this, *NextZXOS* will ask for confirmation by printing

```
Erase d:*.* ? (Y/N)
```

on the bottom of the screen and assuming that you really mean to wipe all the files from the disk in drive **d:**, you would then type **Y**.

If you attempt to delete a single file (or a group of files using *wildcards*) while there are no files on the drive that match the *filespec* a **File not found** error will be displayed.

The dot command equivalent to **ERASE** is called **.rm** (from remove) and its syntax follows that of **ERASE** with the exception of two switches namely **--verbose** and **--help**.

#### MOVE

**MOVE** is a very powerful command. It performs a total of five functions: *moving* and *renaming* files, *changing* file *attributes* and manually *mounting* and *dismounting drives*. Since there are separate sections for the last three functions; we'll cover only the first two here. For *moving* and *renaming*, **MOVE**'s syntax is:

**MOVE** *source_filespec* **TO** *destination_filespec*

where *source_filespec* and *destination_filespec* follow everything discussed in the *Filenames section* earlier with the following considerations:

- You cannot use *wildcards* in either the *source* or the *destination*. This means that both *source* and *destination* have to be *complete filenames*.
- You cannot perform a **MOVE** operation between drives

Let's examine what will happen in the first case. Assuming you have 3 NextBASIC files, named **HELLO1.BAS**, **HELLO2.BAS** and **HELLO3.BAS** in drive **m:** (in the default *User Area* **0**) and you want to move them to *User Area* **1**, typing as you would probably expect:

```
MOVE "*.bas" TO "1:"
```

will fail with **Bad Filename, 0:1**. To perform this you should actually do:

```
COPY "*.bas" TO "1:"
```

followed by

```
ERASE "*.bas"
```

In the second case (and since we now learned our lesson we won't be using wildcards) attempting to MOVE one file between drives like so:

```
MOVE "c:/test.bas" TO "d:/test.bas"
```

will fail with **No rename between drives, 0:1**. To perform this you should actually do like above:

