@ira_76
macOS Oct 21, 2026

rmdir on the mac terminal says directory not empty

Cleaning up some old project folders in Terminal on my Mac. rmdir refuses because there are files inside. What's the command to remove the folder and its contents, and can I get it to ask before each file?
1

Leave A Reply

Log in to post an answer.

1 Answer

noraj Oct 23, 2026
ira_76
rmdir only deletes empty folders. there's almost always a hidden .DS_Store in there making it count as not empty even when finder shows nothing - ls -a will show it. rm -r foldername takes the folder and everything inside. check the name before you hit enter, it doesn't go to the bin.