Linux ‘find’ to list files less than or greater than a certain size

number of files, linux, ubuntu, red hat

This article will go through some basic examples on how to list files above or below a certain size in Linux using the find command. There are many use cases for running queries like this, for instance finding small files on your hard drive or finding very large files. So, lets get started with some examples.

Using find to show files below a certain size (1000 bytes = 1K)

find . -type f -size -1000 -ls

Using find to show files above a certain size (1,000,000 bytes = 1M)

find . -type f -size +1000000 -ls

In the above commands, the -ls command will display the file size, date, and other attributes regarding the file. If you would like just the path and filename, then omit the -ls.

See also  How to change screen/display resolution in Ubuntu 9.10
Photo of author
As Editor in Chief of HeatWare.net, Sood draws on over 20 years in Software Engineering to offer helpful tutorials and tips for MySQL, PostgreSQL, PHP, and everyday OS issues. Backed by hands-on work and real code examples, Sood breaks down Windows, macOS, and Linux so both beginners and power-users can learn valuable insights. For questions or feedback, he can be reached at sood@heatware.net.