Vidyalelo
Computer Science · Q80

Disk Operating System (DOS)

Engineering and GATE · Computer Science · question 80

Q80

Which command is used to delete all the files extension .txt on the current drive and directory?

A.
Del .txt
B.
Erase .txt
C.
Del *.txt
Answer
D.
Del *.*/p

Answer: Option C

Solution

Answer: Option C
Solution:
Del *.txt is the command used in DOS to delete all files with the extension .txt from the current drive and directory.

The del command in DOS is used to delete files.
*.txt specifies that all files with the .txt extension should be deleted.
When you execute del *.txt at the command prompt, DOS will delete all files ending with .txt in the current directory.

Del .txt is not the correct syntax for deleting files with a specific extension; it would attempt to delete a file named ".txt".

Erase .txt is not a valid command in DOS for deleting files; the correct command is del instead of erase for file deletion.

Del . /p is incorrect because the /p switch is not used for deleting files. It typically stands for prompting before deleting, but it's not part of the standard del command syntax.

Therefore, the correct answer is Option C: Del *.txt.