HeatWare.net header image
HeatWare.net
TwitterRSSEmail
  • Home
  • Windows
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
  • Linux/Unix
  • Mac
  • Mobile
    • Android
    • iOS
    • Phones (Help / Resources)
  • Software / Programming
    • Free Software
    • Programming – General
    • PHP
    • Ruby/Rails
    • Quality Assurance (QA)
    • Software – General
    • Software Help
    • Databases
  • Cool Websites
  • Other
    • Deals & Bargains
    • News
    • Video Games
    • Hardware
    • Electronics
  • About

2 comments / April 16, 2012 / sood / Linux/Unix

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

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.

Related Posts

  • How to Find Files Owned by Users(s) in Linux
  • How to Find Files Owned by Group(s) in Linux
  • How to compare 2 files using 'diff' in Linux
  • Linux - How to find the number of files in a folder?
  • How to create a large number of files in Linux (thousands or millions)

find Linux

2 comments… add one
  1. Alex April 14, 2014, 3:40 am

    Thanks for the tip.

    for the record, on ubuntu 12.04, I had to use this:

    find . -type f -size -1000c -ls

    the small ‘c’ is required to work with bytes, otherwise it uses 512-byte blocks (e.g. option ‘b’ instead of ‘c’). Counter-intuitive, I know …

  2. sood (admin) April 14, 2014, 1:49 pm

    Alex,

    Thanks for leaving your feedback on the article and suggested a change for Ubuntu!

    heat

Cancel reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Why You Should Consider Diving Apps
  • How to Buy a Smartphone that Fits Your Budget
  • How to Overcome Frustrating PDF Stress
  • Convert PDF to Word: Easy, Reliable and Quality Conversion
  • PDF to Excel App ­ – A New Way of Handling Tricky Documents

Recent Comments

  • Valarie Walter on Basic Troubleshooting Steps for your Cell Phone
  • John Mists on A Brief History of Android OS
  • syarif on PostgreSQL: How to reload config settings without restarting database
  • Raghu on How to SSH to a server using Ruby – Part I
  • francisco clemente on Basic Troubleshooting Steps for your Cell Phone

Tags

ACSLS Android Bargain Cell Phones Cool Software Cool Websites Databases Deals Ebooks Facebook Free Software G2x Galaxy S5 iOS iPhone Kindle LG Linux Linux/Unix Mac Mobile mysql Office OpenStack OS X PHP Postgres PostgreSQL ruby Samsung Galaxy S6 Shell Smartphones Sun T-Mobile Tips Tips & Tricks Ubuntu Unix Virtualization VMWare Windows Windows 7 Windows 8 Windows Vista Windows XP

Latest Tweet

Follow @HeatwaredotNet

SP
@HeatwaredotNet

  • Why You Should Consider Diving Apps https://t.co/Is41cdUv2I #diving-apps
    about 6 years ago

All Categories

Other Links

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2015 — HeatWare