How Do I List Nonzero Bytes in Unix?
Contents

How do I find nonzero bytes in Unix?

Find all (non-)empty files in a directory

Finding all empty files in a directory can also be done using a single command. Ditto for non-empty files. By default, the find command excludes symbolic files. Use the -L option to include them.

How do I list empty files in Unix?

3 Answers

  1. find . This starts find looking for files in the current directory.
  2. -maxdepth 1. By default, find searches recursively through subdirectories. This tells it not to. …
  3. -type f. This limits the search to regular files.
  4. -name ‘*.txt’ This limits the search to . txt files.
  5. -empty. This limits the search to empty files.
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest