4 ms·
Technically deleting a directory is done with the rmdir command. But rm with flags is flexible enough that I've seen very few people use rmdir
by Felk 6y ago
Technically deleting a directory is done with the rmdir command. But rm with flags is flexible enough that I've seen very few people use rmdir
- Anarch157a 6y agormdir is usefull when you want to remove all empty subdirs, without touching files or directories with files. Just do 'rmdir *' and you're done.
- account42 6y agoI like using rmdir even for individual directories that I think are empty just so that I don't accidentally delete any files that I did not expect to be there.
- Splognosticus 6y agoI use it whenever I expect a directory to be empty and want an error if for whatever reason it isn't. It's a bit niche, but good to have in your toolbelt.