Tamaño de metadatos de un directorio en Linux
Tenemos un directorio temporal en el que se almacenan sesiones de PHP como ficheros, con un formato tal que asi: sess_8scb992k7jks3bsfhnpbmtthn3 Habia tantos que no se podian borrar con el tradicional rm. Al final un compañero utilizó esta respuesta:cd yourdirectory perl -e 'for(<*>){((stat)[9]<(unlink))}' [/code] Al terminar, el espacio ocupado por metadatos seguía igual: [code] [root cms-prod tmp]# ll total 0 [root cms-prod tmp]# cd .. [root cms-prod var]# ls -lh total 543M ... drwxr-xr-x 2 root root 543M Jul 21 10:29 tmp [/code] Leyendo en <a href="https://unix.stackexchange.com/a/49615">este otro enlace</a>: <blockquote> Directory sizes can also grow dynamically as they get filled, but once filled the space reserved for meta-data cannot be re-allocated without removal of the directory. </blockquote> Así que: [code] [root cms-prod var]# rm -rf tmp [root cms-prod var]# mkdir tmp [root cms-prod var]# ll total 44 ... drwxr-xr-x 2 root root 4096 Jul 21 10:33 tmp