1

How to delete all empty directories starting with 201 ?

The command must not execute recursive.. Only directories in the current directory

find /var/www -type d -name "201*" -exec rm {} \

This returns

find: missing argument to `-exec'
clarkk
  • 1,837

1 Answers1

4

you can simply run

rmdir 201*/

rmdir will only delete empty directories and 201*/ matches all subdirectories of the current one starting with 201.

if you don't want to change to the respective directory before, you can use the full path:

rmdir /var/www/201*/
Thawn
  • 1,002
  • 7
  • 13