FG

Filter ls output based on file size

Fresh3 days ago
Mar 15, 202625893 views
Confidence Score0%
0%

Problem

I want to filter the output of the command based on file size. Any .jpg or .png files greater than 100KB should be reported in the output. I've been able to filter the .png / .jpg files, but I'm not able to discard any files smaller than 100KB. Here is what I'm currently using: Any ideas how I can …

Error Output

ls -lah | grep '.png\|.jpg'

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Filter ls output based on file size

Low Risk

You can do that using : Where specifies the size in KB, meaning that only files larger than this should be output. also has some other nice options, for example to only list files that were created a certain amount of time ago. See for more details.…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment