How Do I Empty a Folder in Linux?
Contents How Do I Empty a Directory in Linux? to Delete an Empty Directory, Use the -D ( –Dir ) Option and to Delete a Non-Empty Directory, and All of Its...
Contents
How do I empty a directory 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 force delete a file in Linux?
To remove file or directory forcefully, you can use the option -f force a deletion operation without rm prompting you for confirmation. For example if a file is unwritable, rm will prompt you whether to remove that file or not, to avoid this and simply execute the operation.