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'
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*/
rmdir /var/www/201*/
– Thawn
Nov 27 '15 at 13:46
;
,find /var/www -type d -name "201*" -exec rm {} \;
– cuonglm Nov 27 '15 at 13:39-maxdepth 1
option for avoiding descending into dirs – FelixJN Nov 27 '15 at 13:47