Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove all the files of zero size in specified directory [closed]

Tags:

linux

unix

ubuntu

Thanks,in advance I want to remove all the zero size files in specified directory,can u tell me the command how to do it on Ubuntu OS.

Thanks' Mukthyar

like image 618
Hema Latha Avatar asked Mar 28 '12 12:03

Hema Latha


People also ask

How do I remove zero size files in Linux?

The first part,-type d -empty -print -delete, will delete all the empty directories, and the second part, -type f -empty -print -delete, will delete all the empty files.

How do I get rid of 0-byte files?

Use * wildcard instead of whole file name if possible to catch any strange characters or spaces in file name.

How do I remove empty directory in Linux?

To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.


1 Answers

find . -size 0c -delete removes all such files in the current folder.

like image 51
soulmerge Avatar answered Nov 16 '22 01:11

soulmerge