Web Niraj
  • Facebook
  • Flickr
  • Github
  • Google
  • Linkedin
  • Twitter
  • Youtube
Online portfolio, code examples and developer blog
  • Home
  • About Me
  • Contact Me
  • Portfolio
  • WordPress
  • Blog
Search the site...
Home» Blog » Finding large files on Mac / Linux

Finding large files on Mac / Linux

0

I recently ran into a problem with disc space on my Mac, requiring me to find and delete large files to free up some space quickly. I found the following command (in Terminal) very useful to find large files of a given size in a given directory.

Syntax for Mac OS X / RedHat / CentOS / Fedora Linux

find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} \; | awk '{ print $9 "/" $11 ": " $5 }'

Syntax for Debian / Ubuntu Linux

find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

I used the following command to find files larger than 500MB in my Home directory on my Mac:

find {/Users/Niraj/} -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 "/" $11 ": " $5 }'

Command Line, Linux

Leave a Reply Cancel reply

Recent Posts

  • Geolocation Using HTML5, jQuery and Google Maps (Interactive Version)

    May 21, 2013
  • Facebook API: Tracking Shares using the JavaScript SDK

    May 11, 2013
  • Backing Up MySQL Databases using Amazon S3

    April 19, 2013
  • Batch Resize Images on Linux Using Mogrify (ImageMagick)

    April 7, 2013

    Contact Me

      • Linkedin
      • Facebook
      • Google
      • Twitter
      • Github

    StackExchange / StackOverflow

    profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

    Tags

    Amazon Web Services Android Apache API Application Backup Bebo Command Line Competition Deployment Example Facebook Facebook Graph API Facebook Places Facebook Social Plugins Fan Page Flash FQL Function Game Geolocation Google Galaxy Nexus Google Nexus One HTML5 iGoogle Image Manipulation iPhone JavaScript jQuery Linux Microsite MySpace PHP Plugin Portfolio RSS Security Server SSL Sysadmin Tutorial Welcome Widget WordPress YouTube
    © 2011-2013 Niraj Shah