How do I delete all files and subdirectories in a directory in Linux?

How do I delete all files and subdirectories in a directory in Linux?
Answer
Remove a directory with files and subdirectories (non-empty directory) Here’s where we would use the “rm” command. You can also remove empty directories with the “rm” command, so you can always use that one. We used the option “-r” to recursively delete all subdirectories (subfolders) and files in the parent directory.
 

Tìm kiếm

Back
Top