How many files do I have on my computer?

Though I use a Mac, I decided to d/l the trial version of MacScan to see if I have any malware on my computer. As I type this, it has scanned 116,000 files. (Zero spyware processes detected, 6 tracking cookies, Zero spyware files.) I wonder how many more files there are to go?

I’m running OS 10.4.7 on a non-Intel machine. Is there anywhere I can look on it that will tell me how many files I have?

I don’t think there is a fast way to do this with the GUI. You can always use something like Grand Perspective, but that will take some time also. You probably have many hundreds of thousands of files on your boot drive - maybe a million of more.

That many? Not to 150,000 yet…

Maybe, maybe not. Depends on how big your hard drive is, and how much of it is filed. For example, I have about 250GB filled on a 320GB hard drive, and there are aproximately 700,000 files. (and yes, I know this from scanning the drive for errors/spyware) If you have a smaller drive, or bigger files - I have thousands of files under 100kb that are text docs and things for games - you might have fewer to scan.

This is an old machine (2005) so it only has a 100GB hard drive. It’s about 95% filled.

Well, I have around 300,000 files just in /System and /Library, and that doesn’t even start to get to all the files that I have in my Users directory.

I have 700,000 files on 350 gigs with about 20gigs free, but mine is really junky and includes backups of thousands of files as well as a couple of complete operating systems on different partitions.

It changes constantly as programs create logs, your computer creates cookies and flash objects and chached html pages, you should change your settings, scanning every file is a waste of time, only a handful can even be infected with a virues

Disk Utility (/Applications/Utilities/Disk Utility) gives you the disk information at the bottom of the window. The total number of files is shown.

I have an old PowerBook G4 with an 80 GB disk and have 721,871 files.

Thanks, Ex Chemist.

384,858 files.

Just as a data point, I have 2,335,672 files on my boot drive.

2,095,291 on mine.

In case any Windows users clicked on the thread and are curious how to do the same thing, the following can be run from the command prompt:


dir c:\ /a:-d /b /s | find /v /c ""

I have 123,650.

Just be prepared for it to take a little while–what you are doing is opening every folder and listing every file on your C: drive, and getting the total from there.

83,482 on Windows 7, this is just my system drive so doesn’t include my backup drive which is full of music and video files.

If you’re more curious about your files, and a bit geeky, in OS X you can run a UNIX tool to quantify fragmentation.
HFSDebug. It provides a percentage of files fragmented, top five fragmented files, and a full count of files on your system.

Download the disk image, mount it, and put this code in the Terminal.


sudo /Volumes/HFSDebug\ Lite\ 4.33/hfsdebug-lite  -V/ -f -t 5

Since it’s a sudo command, you’ll be prompted to enter your password. It’ll run for a while, throwing up text about each of the files as it analyzes. There are different things you can do to poke around under the hood if you want to play with this tool. You can read the page and set flags for whatever you want to do.

OS X is pretty good about dealing with file fragmentation on its own, which is why there aren’t many defrag programs for it. My system has 0.566% fragmentation, almost all of it in a few large files ripped from DVDs that span different sectors.

I have 849,768 files on my drive.

For Windows techies, I recommend this free command line utility DU (disk usage): http://technet.microsoft.com/en-us/sysinternals/bb896651.aspx

To just count the files on your C: drive, the command is: DU C:
But it can do more than that. You can tell it how many levels to recurse down and it will give you the size of each folder which is very useful for freeing up disk space.

The following works on Unix-like systems, probably including Mac OS X:


sudo find / -type f | wc -l