Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Getting Started with the Console Moving and Deleting Files

Jordan Budisantoso
Jordan Budisantoso
154 Points

"rm -r" vs "rmdir"

When removing a directory, what's the difference between "rm -r" and "rmdir"?

2 Answers

Michael Hulet
Michael Hulet
47,912 Points

rmdir only works if the folder is empty. rm -r will remove the folder and everything inside of it

Jon Brady
Jon Brady
10,868 Points

rmdir will remove empty directories...... rm -r will remove files or directories and -R, --recursive remove directories and their contents recursively

Jon Brady
Jon Brady
10,868 Points

this site might help you for things like this http://explainshell.com/

Jordan Budisantoso
Jordan Budisantoso
154 Points

That site is $$$money$$$ thanks for the share! :)