Como eliminar directorios vacíos [Linux]

Existen varias maneras (comandos) para eliminar directorios vacíos.En este post,algunos ejemplos que he reocpilado:

Cleanlinks
cd /ruta
cleanlinks

for v in targetdir/*; do [ $(ls -lA $v | wc -l) -eq 1 ] && rmdir $v; done;

find /home/nico -type d -empty -delete

rm -rf directory-name

rmdir directory-name

find -depth -type d -empty -exec rmdir {} \;

xargs pude ser mas rápido que -exec

find . -type d -empty | xargs rmdir

perl -MFile::Find -e"finddepth(sub{rmdir},'.')"

Explicación detallada del último comando » duramecho.com

Enjoy!.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s