0

I am looking for a simple .sh script which can scan the current folder and sub folders recursively for 0 byte files. I know this can be done in only a few lines, but I'm quite noobian on the command line of Linux. It would be great if the output could be listed to a text file, like > 0byte.txt.

1 Answer 1

3

Use find command:

find /path/to/directory -type f -empty > zerobyte.txt
  • -type f look only for files
  • -empty finds empty files
1
  • thanks ! it works ! i changed the path so that i could scan the current folder and all of its subfolders - find ./ -type f -empty > 0byte.txt Jan 31, 2020 at 15:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .