find empty files or non-empty files in a folder

The case is when I run condor, I will get some .out, .error files. if there are errors, the .error file will not be empty, otherwise, it will be empty.

first, let’s get into the logs folder, then type

find . -type f -empty

find empty files

find . -type f -not -empty

find non empty files

find ./*.error -type f -not -empty

find non empty error files

reference:
https://www.cyberciti.biz/faq/unix-linux-find-all-empty-files/
https://superuser.com/questions/191889/how-can-i-list-only-non-empty-files-using-ls

你可能感兴趣的:(Ubuntu)