-3

This question already has an answer here:

I have multiple text file around 2000 text file in folder. I want to remove those file which are blank file.

marked as duplicate by jasonwryan, slm linux Jul 13 '18 at 5:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @jasonwryan Possibly, but is a file with whitespace a "blank file" here? – Sparhawk Jul 13 '18 at 5:12
  • @Sparhawk FIIK: there is no actual detail in the question. – jasonwryan Jul 13 '18 at 5:17
0

Firstly, use the following command to identify all the empty files.

find -size 0

Then, to delete, run the following command.

find -size 0 -delete

N.B. this is recursive, i.e. descends into all sub-directories. If you only want to act on the current directory, add the following option.

-maxdepth 0

Not the answer you're looking for? Browse other questions tagged or ask your own question.