We've moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://www.techimperial.com
and update your bookmarks.

Saturday, May 5, 2012

Find Large Files in Other on iTunes, Other Files in iPhone, iPad, iPod and iOS

iTunes Other on iOS device, large unknown files.

Find Other Large Files in iTunes on your iPhone, iPad, or iPod with Gawk

After upgrading your device to a new iOS or even after just downloading too many Cydia tweaks or Apps, you notice that when you plug in your device to iTunes you see a whopping amout of hard disk space being taken up as "Other" in iTunes and the only problem is: You have no way of finding out exactly what these large Other files are!

Fret no more, we will explore the world of terminal commands on a jailbroken iOS, this guide will show you how to make an automatic list of all unimportant files larger than 20 megabytes and their location in a sorted list format. Of course you can edit the 20 megabytes part to whichever number you would like.

Note: Below is the default location where the output "files.txt" will be located that you will create using this guide on iOS (your jailbroken device) and below that is the Gawk command we use during our SSH session to compile the list.

Default Directory for files.txt:
/ (root)

Gawk Command:
find / -iname "*" -ls | sort -rn -k 7.1 | gawk 'BEGIN {OFS="\t"} {if ($7 > 20971520) print $7,$11 " " $12 " " $13 " " $14 " " $15 " " $16 " " $17 " " $18 " " $19 " " $20}' > files.txt


Requirements
PuTTY (Installer) (Software)
WinSCP (Software)
OpenSSH (Cydia Package)
Core Utilities (Cydia Package)
Gawk (Cydia Package)
Jailbroken iPhone (Hardware)

    Instructions
  1. First, install PuTTY using the (putty-0.62-installer.exe) installer.
  2. Now open Cydia on your jailbroken iPhone and Queue Core Utilities, OpenSSH and Gawk. (To see them listed, make sure you are in "Developer" mode for Cydia, you can check this in: Cydia > Manage > Settings)
  3. Now you just want to install WinSCP.
  4. Next, open WinSCP and login (user: root, password: alpine) through SSH to your device (iPhone, iPad, etc, you need to enter your device's local ip address, something like 192.168.x.xx), click yes to any security warnings or key dialogs.
  5. After you connect to your device in WinSCP, goto the root directory of your device and then on the toolbar menu in WinSCP click the PuTTY icon (it looks like two terminals).
  6. You should now see the PuTTY terminal window open, it asks you to enter a password, enter alpine.
  7. Next copy the Gawk command in the red box above these instructions and right click in the terminal window to paste it, next hit enter.
  8. That command just executed and you will now find a text document named "files.txt" in the root of the device, give it about 3 minutes to finish processing the list, then download it to your computer and check out the list.
  9. The list will show you the largest items in order, you can edit the Gawk command to change what file size it looks for. (It is in bytes, so 20971520 is 20 megabytes when converted) (As a security measure, you may want to remove OpenSSH after this if you do not know how to use it)


2 comments:

  1. Looks like I have the same problem except my "Other" space is 10 gigs. Tried using this trick but my iphone doesn't seem to have a sort command. Is there a software bundle I'm missing?

    ReplyDelete
    Replies
    1. Oh yes, I nearly forgot, you will need to install Core Utilities from Cydia in order for the sort command to work.

      Delete