Quick Answer: How Do I Remove a Subdirectory in Unix?
Contents to Remove a Directory and All Its Contents, Including Any Subdirectories and Files, Use the Rm Command with the Recursive Option, -R. Directories That...
To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.
How do I delete a subdirectory in Linux?
To delete an empty directory, use the -d ( –dir ) option and to delete a non-empty directory, and all of its contents use the -r ( –recursive or -R ) option. The -i option tells rm to prompt you to confirm the deletion of each subdirectory and file.
Must Read
How do I delete a sub folder?
To delete a folder with subfolders with a command, use these steps:
- Open Start on Windows 10.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to delete an empty folder and press Enter: rmdir PATHTOFOLDER-NAME.