How to delete folders through Terminal?

How do you delete files and folders through Terminal?

MacBook Pro Mid 2012-OTHER, macOS Sierra (10.12.4), The last Mac with removable RAM!

Posted on May 8, 2017 1:40 PM

Reply
2 replies

May 8, 2017 1:50 PM in response to Exr0n

Hello Exr0n,

While Kappy is technically correct, rmdir is rarely used in practice. It will only remove an empty directory. Usually people do "rm -Rf /path/to/folder" to remove a folder.


Just remember to have a backup. There is no undo or trash can in the Terminal. When you delete a file in the Terminal, it is gone for good.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to delete folders through Terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.