2

In this answer https://askubuntu.com/a/216889/50183 I found a command to list all files, filled with zeros:

find -type f -printf "%S\t%p\n" 2>/dev/null | awk '{if ($1 < 1.0) print $1 $2}'

unfortunately, it can't capture filenames and pathes with spaces.

How to improve?

Dims
  • 1,803

1 Answers1

4

This is a bit of a red herring - find is capturing the files and printing the names correctly. All you need to do is have awk print the whole record instead of just the first two fields:

find -type f -printf "%S\t%p\n" 2>/dev/null | awk '{if ($1 < 1.0) print $0}'

or instead, tell it to only split on tabs, not any whitespace:

find -type f -printf "%S\t%p\n" 2>/dev/null | awk -F"\t" '{if ($1 < 1.0) print $1 $2}'
Zanna
  • 70,465