How can I list (using ls) all files that are not empty (size > 0) using linux?
| ||||
|
feedback
|
|
I'd use | |||||||
feedback
|
|
This is a job for find ls is not powerful enough.
Edit: | |||||||||||
feedback
|
|
Ls has almost no option to filter files: that's not its job. Filtering files is the job of the shell for simple cases (through globbing) and the job of find for complex cases. In zsh, you can the
Users of other shells must use find. With GNU find (as found mostly on Linux):
A POSIX-compliant way is:
If | |||
|
feedback
|
|
| |||||
feedback
|
will work better if you want all non empty files, rather than just directories. | ||||
|
feedback
|
If you are intent on using ls, you need a little help from awk | |||
|
feedback
|
|
Bash 4.0+
| |||
|
feedback
|
