Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete both: hidden and normal files with cmd

Following line recursively deletes only HIDDEN files with .mta extension

del /S /A:H <folder_name> *.mta

What I want to do is, to delete both: hidden and normal files with .mta extension. How to do it?

like image 863
Tural Ali Avatar asked Dec 11 '11 12:12

Tural Ali


People also ask

Does rm * remove hidden folders?

rm -rf /some/path/. * deletes all hidden files in that dir (but not subdirs) and also gives the following error/warning: rm: cannot remove directory: `/some/dir/.

How delete hidden files in DOS?

Use the dir /a command to list all files (including hidden and system files). Then use the attrib command with -h to remove hidden file attributes, -s to remove system file attributes, or -h -s to remove both hidden and system file attributes.

How delete all files and folders using cmd?

The del command displays the following prompt: Are you sure (Y/N)? To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER.


1 Answers

Use /a on its own: del /s /a *.mta

eg:

C:\temp\z>attrib *
A   H        C:\temp\z\hidden
A            C:\temp\z\normal
C:\temp\z>del /s /a *

C:\temp\z\*, Are you sure (Y/N)? y
Deleted file - C:\temp\z\hidden
Deleted file - C:\temp\z\normal
like image 83
patthoyts Avatar answered Sep 30 '22 07:09

patthoyts