码迷,mamicode.com
首页 > 其他好文 > 详细

How to remove all the empty files or directories?

时间:2014-10-22 10:58:14      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   color   io   os   ar   java   for   

How to remove all the empty files or directories?

How to remove all the empty files or directories?

I am confused why I get many empty directories inside my Downloads directory, and I have to remove all of the empty ones. Here is what I did:

find home/wujing/Downloads -empty -type d -delete

The -type option tells find to match only directories, another similar option is -type f which matches regular files. The -delete option will actually delete all of the matched items.

The xargs can do the same job.

find run/shm -type d -empty -print0 xargs -0 -I {} rmdir "{}"

Author: wujing

Created: 2014-10-22 三 10:02

Emacs 24.3.1 (Org mode 8.2.6)

Validate

How to remove all the empty files or directories?

标签:des   style   http   color   io   os   ar   java   for   

原文地址:http://www.cnblogs.com/wujingcqu/p/4042372.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!