CMD Master
Back to Blog
Arnošt Havelka

The Delete Command

Remove unwanted files forever.

Start Interactive Lesson
The Delete Command

The Delete Command (del)

When you need to clean up, del (or erase) is your friend. Be careful! Files deleted from the command line do not go to the Recycle Bin. They are gone immediately.

Usage:del
[filename]
[/p]
[/f]
[/s]
filename
The file(s) to delete.
/p
Prompts for confirmation before deleting each file.
/f
Forces deletion of read-only files.
/s
Deletes specified files from all subdirectories.

Real-World Examples

Delete a specific file:

Command Prompt
C:\Users\User>del secret.txt

Delete all files in a directory (clean folder):

Command Prompt
C:\Users\User>del /q Temp*

Knowledge Check

1 / 2

Where do files go after 'del'?

Up Next

Practical: Ver

Scenario: Checking OS compatibility.