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 "{}" |