Finding and removing large files on iPhone

Imported from the WayBack machine:

Finding and removing large files on iPhone
Posted on May 8, 2012 by johndball

I recently had an issue in which a movie partially downloaded to my iPhone. For some reason the download failed but, instead of picking up where the partially downloaded file left off, my iPhone started downloading the same movie twice. I was left with about 1.6 GB of junk that I couldn’t remove automatically (iTunes purge, resume downloads, etc). This data was showing in iTunes as “Other Data”. This is a good time to note that “other data” doesn’t mean all junk; it is other data not categorized by the limited categories displayed in iTunes.

Having previously jailbroken my iPhone 4S running iOS 5.0.1, I knew I had the tools available to me to delete the junk files but still had no way of searching for files by size (those tools: mobile terminal for iOS 5 and ifile). Then I stumbled across this website:

Following the instructions, I installed “Gawk” from Cydia then used the SSH terminal in iFunBox. (I had forgotten my SSH password since the last time I SSH’d into my iPhone, that took an additional 30 minutes to research, figure out, and correct. I won’t go into the details but you can find everything you need to reset a forgotten SSH password here: and here: )

Once I had my SSH password reset and Gawk installed, I SSH’d into my phone using iFunbox and ran this command:

find / -iname “*” -ls | sort -rn -k 7.1 | gawk ‘{print $7,$11}’ > files.txt
(copy/paste the above line into notepad to determine spaces between characters)

This created a text file called “files.txt” in the folder /private/var/root/. Contained within the text file was largest to smallest files sorted from top to bottom.

I copied the text file to my laptop and opened it in notepad. Once opened, the very first file listed was the target file: ~1.6 GB located in /private/var/mobile/library/ifile/trash/var/mobile/media/purchases/(garbage file). I nuked this file and reclaimed my precious 1.6 GB of free space.

Leave a Reply

Your email address will not be published. Required fields are marked *

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