Previous Next Chapter

DELETE

Deletes files or directories.

Format

DEETE {<name | pattern>} [ALL] [QUIET] [FORCE]

Template

FILE/M/A,ALL/S,QUIET/S,FORCE/S

Location

C:

DELETE attempts to erase the specified items. You can delete multiple items at the same time by listing them individually or by using a wildcard to delete a specific set of files matching a pattern. The pattern can specify directory levels, as well as names. To abort a multiple-item DELETE, press Ctrl+C. A multiple-item DELETE aborts if and when it finds something that cannot be removed; for example, a file is delete-protected or in use. A pattern matching DELETE removes everything it can and lists the items that it did not delete, if any.

Note:

AmigaDOS does not request confirmation of deletions. Do not use pattern matching to delete things if your are not familiar with the procedure; deleted items cannot be recovered, unless you have an up-to-date backup of the items deleted.

An error message warns you that you cannot delete directories that still contain files. Override this using the ALL option. DELETE ALL deletes the named directory, its subdirectories, and all files.

File names are displayed on the screen as they are deleted. To suppress the screen output, use the QUIET option.

If the d (deletable) protection bit of a file or directory has been cleared, that item cannot be deleted unless the FORCE option is used.

Example 1:

1> DELETE Old-file

deletes the file named Old-file in the current directory.

Example 2:

1> DELETE Work/Prog1 Work/Prog2 Work

deletes the files Prog1 and Prog2 in the Work directory and then deletes the Work directory if it contains no other files.

Example 3:

1> DELETE T#?/#?(1|2)

deletes all the files that end in 1 or 2 in directories that start with T.

Example 4:

1> DELETE DF1:#? ALL FORCE

deletes all the files on DF1:, even those set as not deletable.

See also: PROTECT. For more examples using DELETE, see Chapter 8.

DIR

Displays a sorted list of the files in a directory.

Format

DIR [<dir | pattern>] [OPT A | I | AI | D | F] [ALL] [DIRS] [FILES] [INTER]

Template

DIR,OPT/K,ALL/S,DIRS/S,FILES/S,INTER/S

Location

C:

DIR displays the file and directory names contained in the specified directory or the current directory. Directories are listed first, followed by an alphabetical list of the files in two columns. Pressing Ctrl+C aborts a directory listing.

The options are:

ALL

Displays all subdirectories and their files.

DIRS

Displays only directories.

FILES

Displays only files.

INTER

Enters an interactive listing mode.

The ALL, DIRS, FILES, and INTER keywords supersede the OPT A, D, F, and I options, respectively. The older keywords are retained for compatibility with earlier versions of AmigaDOS. Do not use OPT with the full keywords - ALL, DIRS, FILES, or INTER.

Interactive listing mode stops after each name to display a question mark at which you can enter commands. The acceptable responses are shown below:

Press Return

Displays the next name on the list.

E

Enters a directory; the files in that directory are displayed.

B

Goes back one directory level.

DEL or DELETE

Deletes a file or empty directory. DEL does not refer to the Del key; enter the letters D, E, and L.

T

Types the contents of a file.

C or COMMAND

Allows you to enter additional AmigaDOS commands.

Q

Quits interactive editing.

?

Displays a list of the available interactive-mode commands.

The COMMAND option allows almost any AmigaDOS command to be executed during the interactive directory list. To issue a command, enter C (or COMMAND) at the question mark prompt. DIR asks you for the command. Enter the desired command, then press Return. The command is executed and DIR continues. You can also combine the C and the command on one line by putting the command in quotation marks following the C.

For example,

? C "type prefs.info hex"

is equivalent to pressing Q to exit interactive listing mode and return to a regular Shell prompt, then entering:

1> TYPE Prefs.info HEX

to display the Prefs.info file on the screen in hexadecimal format.

Formatting a disk from the DIR interactive mode is not recommended since the format takes place immediately, without any confirmation requesters appearing. Do not start another interactive DIR from interactive mode since it results in garbled output.

Example 1:

1> DIR Workbench:

displays a list of the directories and files on the Workbench disk.

Example 2:

1> DIR MyDisk:#?.memo

displays all the directories and files on MyDisk that end in .memo.

Example 3:

1> DIR Extras: ALL

displays the complete contents of the Extras drawer: all directories, all subdirectories, and all files, including those in the subdirectories.

Example 4:

1> DIR Workbench: DIRS

displays only the directories on Workbench.

Example 5:

1> DIR Workbench: INTER

begins an interactive list of the contents of the Workbench disk.

For more examples using DIR, see Chapter 8.

DISKCHANGE

Informs the Amiga that you have changed a disk in a disk drive.

Format

DISKCHANGE <device>

Template

DRIVE/A

Location

C:

You must use the DISKCHANGE command to inform the system when you change disks or cartridges in 5.25 inch floppy disk drives or removable media drives without automatic diskchange hardware.

Example:

If a requester asks you to insert a new disk into your 5.25 inch drive, known as DF2:, you must insert the disk and then enter:

1> DISKCHANGE DF2:

AmigaDOS then recognizes the new disk and you can proceed.

Top Previous Next Chapter