rianto isaac's Weblog

rianto utomo isaac sahala utomo

linux, folder empty find

leave a comment »

How to find empty folders on Linux

Posted on October 17, 2008

Tips: How to find an empty folders on Linux box

In order to do some folder maintenance job, you may require to find an empty folder on Linux box. I would like to share tips here:

# find /path -type d -empty

Find empty folder and list
# find /path -type d -empty -exec ls -ld {} \;

Find empty folder and save as temporary file
# find /path -type d -empty -exec ls -ld >> /tmp/savefiles.txt {} \;

Find empty folder and delete
# find /path -type d -empty -exec rm -rf {} \;

rianto utomo bole nyontek dari http://www.planetmy.com/blog/how-to-find-empty-folders-on-linux/

Written by isaaconi

Juli 10, 2009 pada 1:59 pm

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: