how to delete a file through cmd code example

Example 1: delete non empty directory cmd

rm -rf directoryname

Example 2: delete a file in cmd windows

del /f filename.type

Example 3: remove file via command line

del filename  -- removes filename

Example 4: how to remove a file in command line

del filename

Example 5: delete command to delete a file in cmd

del filename

Example 6: rm directory linux

To remove an empty directory, use either rmdir or rm -d followed by the directory name: 
rm -d dirname rmdir dirname.
To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option: 
rm -r dirname.

Tags:

Misc Example