Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > iPhone, iPod and iPad > iOS > Jailbreaks and iOS Hacks

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 25, 2010, 03:21 AM   #1
SDAVE
macrumors 68020
 
Join Date: Jun 2007
Location: Nowhere
Find the largest file on iPhone?

Hi,
my "other" usage has skyrocketed and I think the same happened in the photos. I have a JB'd iP4.

Fully aware about the Rock log issue, and I have gotten rid of Rock and the log file, but the Other usage is about 1GB and photos are 4.48GB (it includes 720p videos, which are only 600MB in size).

Any way to find out what are the largest files on the iPhone through SSH?
__________________
iPhone 5, MacBook Pro (2011), Mac Pro 2008, Apple Cinema Display 30" Aluminium
SDAVE is offline   0 Reply With Quote
Old Aug 25, 2010, 03:40 AM   #2
TangoDown
macrumors regular
 
Join Date: Jul 2010
Location: UK
I'd be tempted to use iFile. A registered copy will allow you to search (& with a wildcard) and see search results based on directory sizes.

Quote:
Added file name search capability. The search can be performed in current directory only or in the whole directory hierarchy starting at the current directory. The search string is case and diacritic insensitive. Searches in Edit mode of the File Browser allow deletion, copying, cutting and zipping of the found and then selected files. Search results show date and size for current directory and path for other directories. Via iFile’s preferences the user can choose if the search string should be of
Simple format: search text contained in filename, e.g. “test”,
Wildcard format, e.g.”*test*”,
Regular Expression format, e.g. “.*test.*”.
TangoDown is offline   0 Reply With Quote
Old Aug 25, 2010, 04:53 AM   #3
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by SDAVE View Post
Hi,
my "other" usage has skyrocketed and I think the same happened in the photos. I have a JB'd iP4.

Fully aware about the Rock log issue, and I have gotten rid of Rock and the log file, but the Other usage is about 1GB and photos are 4.48GB (it includes 720p videos, which are only 600MB in size).

Any way to find out what are the largest files on the iPhone through SSH?
Install "gawk" from Cydia. SSH into your iPhone and run this command:

find / -iname "*" -ls | sort -rn -k 7.1 | gawk '{print $7,$11}' > files.txt

The text file will contain a sorted list of all files with the largest files at the top of the list. There are two fields separated by a space. The first field is the file size and the second field is the file name including full path.

If you prefer the file name first, switch the 7 and 11 in the gawk command.

On my iPhone the file was 5.5MB in size so make sure you have room.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 25, 2010, 07:10 AM   #4
dhlizard
macrumors G3
 
dhlizard's Avatar
 
Join Date: Mar 2009
Location: The Jailbreak Community
Quote:
Originally Posted by sidewinder View Post
Install "gawk" from Cydia. SSH into your iPhone and run this command:

find / -iname "*" -ls | sort -rn -k 7.1 | gawk '{print $7,$11}' > files.txt

The text file will contain a sorted list of all files with the largest files at the top of the list. There are two fields separated by a space. The first field is the file size and the second field is the file name including full path.

If you prefer the file name first, switch the 7 and 11 in the gawk command.

On my iPhone the file was 5.5MB in size so make sure you have room.

S-
What repo is gawk in ?
__________________
Two iPhone 5S
iPad 4 iPad Air AppleTV 2
MacBook Pro Two iMacs

Look for me here Jailbreak/Unlock Chart
dhlizard is offline   0 Reply With Quote
Old Aug 25, 2010, 07:18 AM   #5
-aggie-
macrumors Demi-God
 
-aggie-'s Avatar
 
Join Date: Jun 2009
Location: Where bunnies are welcome.
Quote:
Originally Posted by dhlizard View Post
What repo is gawk in ?
It's from Sauriks (apt.saurik.com).
__________________
Google with site:macrumors.com as a parameter.
DFU Mode
-aggie- is offline   0 Reply With Quote
Old Aug 25, 2010, 07:21 AM   #6
dhlizard
macrumors G3
 
dhlizard's Avatar
 
Join Date: Mar 2009
Location: The Jailbreak Community
Quote:
Originally Posted by -aggie- View Post
It's from Sauriks (apt.saurik.com).
Odd, not showing up for me under that source ??

I can just grab the .deb file.
__________________
Two iPhone 5S
iPad 4 iPad Air AppleTV 2
MacBook Pro Two iMacs

Look for me here Jailbreak/Unlock Chart

Last edited by dhlizard; Aug 25, 2010 at 07:27 AM.
dhlizard is offline   0 Reply With Quote
Old Aug 25, 2010, 08:45 AM   #7
dhlizard
macrumors G3
 
dhlizard's Avatar
 
Join Date: Mar 2009
Location: The Jailbreak Community
Sorry to be a noob about this, but in what directory will the text file be created ?

Edit: Found it... private/var/root
__________________
Two iPhone 5S
iPad 4 iPad Air AppleTV 2
MacBook Pro Two iMacs

Look for me here Jailbreak/Unlock Chart

Last edited by dhlizard; Aug 25, 2010 at 08:52 AM.
dhlizard is offline   0 Reply With Quote
Old Aug 25, 2010, 10:03 AM   #8
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by dhlizard View Post
Sorry to be a noob about this, but in what directory will the text file be created ?

Edit: Found it... private/var/root
Actually, the text file will be created in the directory your are in (the current working directory) when you run it.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 25, 2010, 12:47 PM   #9
SDAVE
Thread Starter
macrumors 68020
 
Join Date: Jun 2007
Location: Nowhere
Quote:
Originally Posted by TangoDown View Post
I'd be tempted to use iFile. A registered copy will allow you to search (& with a wildcard) and see search results based on directory sizes.
Thanks for the help.

Quote:
Originally Posted by sidewinder View Post
Install "gawk" from Cydia. SSH into your iPhone and run this command:

find / -iname "*" -ls | sort -rn -k 7.1 | gawk '{print $7,$11}' > files.txt

The text file will contain a sorted list of all files with the largest files at the top of the list. There are two fields separated by a space. The first field is the file size and the second field is the file name including full path.

If you prefer the file name first, switch the 7 and 11 in the gawk command.

On my iPhone the file was 5.5MB in size so make sure you have room.

S-


What a life saver!! Thank you.

Seems like Gawk wasn't available in the repo so I just found the .deb online.

Anywho, it found all the large files and there seems to be discrepencies so will clean those files out with iPhone Explorer (Great app, btw. Don't need to SSH with FUGU over WiFi anymore. It's fast over USB)
__________________
iPhone 5, MacBook Pro (2011), Mac Pro 2008, Apple Cinema Display 30" Aluminium
SDAVE is offline   0 Reply With Quote
Old Aug 25, 2010, 12:56 PM   #10
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by SDAVE View Post
What a life saver!! Thank you.

Seems like Gawk wasn't available in the repo so I just found the .deb online.
You're welcome.

I keep forgetting that to see some of these packages on Cydia you need to be setup as a "Hacker (+ Command Line)" or "Developer (No Filters)". To do this, tap on "Manage" then "Settings".

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 25, 2010, 01:26 PM   #11
liquid85
macrumors member
 
Join Date: Feb 2010
I'm having this same problem. I ran gawk and I'm looking at the list of files but I really don't know what to delete. I really kind of a newb at this. I have almost 5 gigs of other space. How do I know what files to remove?
liquid85 is offline   0 Reply With Quote
Old Aug 25, 2010, 05:16 PM   #12
SDAVE
Thread Starter
macrumors 68020
 
Join Date: Jun 2007
Location: Nowhere
Quote:
Originally Posted by liquid85 View Post
I'm having this same problem. I ran gawk and I'm looking at the list of files but I really don't know what to delete. I really kind of a newb at this. I have almost 5 gigs of other space. How do I know what files to remove?
Well for me, I had extra *cough* .ipa files in there and didn't know they were there. They were huge too.

Also the list showed me .mov files which were shot with my iPhone 4 and they were 1+ gigs per file, so I dumped those to my computer and deleted them off the phone.

Just look at the list and see what the largest files are. If it's a 1GB MP3, then something is wrong and that file needs to be deleted. After cleaning up I have 4GB of space now. If I dump all of my photos and videos I'll have 5GB back too, so I plan to do that soon.

Some apps are huge too, so be careful not to delete those. If you want to delete large video files, try to find which one it is and delete it from the iPhone instead, using the Photos app. If it's a movie, delete it from the phone or through iTunes. It's safer this way.

I think I originally came to this problem with the Rock app and it's huge log file. I recently had Rock installed, removed it again, and there was 0 space for some reason, again.

One of the issues I Have with jailbreaking is that you don't know which app takes up extra space, so this terminal command line code with gawk is really useful for maintaining the space once in a while.
__________________
iPhone 5, MacBook Pro (2011), Mac Pro 2008, Apple Cinema Display 30" Aluminium
SDAVE is offline   0 Reply With Quote
Old Aug 25, 2010, 05:51 PM   #13
liquid85
macrumors member
 
Join Date: Feb 2010
Yeah thanks for posting. I've been looking at the files close and I noticed doubles of all my apps. I deleted navigon and my "other" storage went down a gig. So that must be the problem. I'm going to go through tonight and delete all the doubles. Besides those double apps could you tell me what these three files are? The artwork ones were the biggest on my phone. I really appreciate it this is a problem I've been trying to find an answer to for a few days.

524288000 /private/var/mobile/Media/iTunes_Control/Artwork/F3105_1.ithmb
333447168 /private/var/mobile/Media/iTunes_Control/Artwork/F3101_1.ithmb
122167270 /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7
liquid85 is offline   0 Reply With Quote
Old Aug 25, 2010, 06:02 PM   #14
dhlizard
macrumors G3
 
dhlizard's Avatar
 
Join Date: Mar 2009
Location: The Jailbreak Community
Quote:
Originally Posted by SDAVE View Post
Well for me, I had extra *cough* .ipa files in there and didn't know they were there. They were huge too.

Also the list showed me .mov files which were shot with my iPhone 4 and they were 1+ gigs per file, so I dumped those to my computer and deleted them off the phone.

Just look at the list and see what the largest files are. If it's a 1GB MP3, then something is wrong and that file needs to be deleted. After cleaning up I have 4GB of space now. If I dump all of my photos and videos I'll have 5GB back too, so I plan to do that soon.

Some apps are huge too, so be careful not to delete those. If you want to delete large video files, try to find which one it is and delete it from the iPhone instead, using the Photos app. If it's a movie, delete it from the phone or through iTunes. It's safer this way.

I think I originally came to this problem with the Rock app and it's huge log file. I recently had Rock installed, removed it again, and there was 0 space for some reason, again.

One of the issues I Have with jailbreaking is that you don't know which app takes up extra space, so this terminal command line code with gawk is really useful for maintaining the space once in a while.
iFile works great for identifying the contents of the music/videos so you can get rid of them/move them.
__________________
Two iPhone 5S
iPad 4 iPad Air AppleTV 2
MacBook Pro Two iMacs

Look for me here Jailbreak/Unlock Chart
dhlizard is offline   0 Reply With Quote
Old Aug 25, 2010, 06:43 PM   #15
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
I guess I should have mentioned that you want to be logged in as root, not mobile, when you run the terminal command I provided in post #3 of this thread. You need permission to access all of the directories on the iPhone.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 25, 2010, 07:13 PM   #16
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
This command may be better if you want to process the output in another program:

find / -name "*" -ls | sort -rn -k 7.1 | gawk 'BEGIN {OFS="\t"} {print $7,$11}' > files.txt

This separates the two fields by a tab character instead of a space. There may be spaces in file names but there will be no tab characters. So a tab delimiter is probably better than a space delimiter in most cases.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 25, 2010, 08:07 PM   #17
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Okay, spaces in directory and file names causes gawk some issues. So we need to do something like this:

find / -name "*" -ls | sort -rn -k 7.1 | gawk 'BEGIN {OFS="\t"} {print $7,$11 " " $12 " " $13 " " $14 " " $15}' > files.txt

This will handle up to 4 spaces in the full path and name. That should be enough to figure out just about any file name. This will append 4 spaces onto file names that have no spaces in their path or name. But that shouldn't be too big of a deal.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Aug 26, 2010, 08:57 PM   #18
liquid85
macrumors member
 
Join Date: Feb 2010
Thanks a lot man. I used Itunes to remove all my apps. The used ssh to remove all the copies. I got my storage back!!!! I'm still curious as to how it happened in the first place though. Thanks for your help.
liquid85 is offline   0 Reply With Quote
Old Jan 12, 2011, 05:21 PM   #19
sstyle
macrumors member
 
Join Date: Nov 2010
cd /
du > files.txt

more helpful for me
sstyle is offline   0 Reply With Quote
Old Jan 13, 2011, 01:57 AM   #20
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by sstyle View Post
cd /
du > files.txt

more helpful for me
Maybe. But probably not for anyone else and certainly not for the OP......

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Jan 13, 2011, 02:10 AM   #21
sstyle
macrumors member
 
Join Date: Nov 2010
Quote:
Originally Posted by sidewinder View Post
Maybe. But probably not for anyone else and certainly not for the OP......

S-
I think size of folders more helpful instead files.

for ex.:

10419002 .
9752328 ./private
9751704 ./private/var
9454560 ./private/var/mobile
8760300 ./private/var/mobile/Applications
1230748 ./private/var/mobile/Applications/741B7C33-F583-4F75-83FE-95E0857195BF
1230660 ./private/var/mobile/Applications/741B7C33-F583-4F75-83FE-95E0857195BF/RAGE.app
1147284 ./private/var/mobile/Applications/89591FD1-0C35-48E6-8536-6725036371EF
1147072 ./private/var/mobile/Applications/89591FD1-0C35-48E6-8536-6725036371EF/nova2.app
660044 ./private/var/mobile/Applications/C035E61A-26EC-4DED-A7D4-C9B2F084B806
659208 ./private/var/mobile/Applications/C035E61A-26EC-4DED-A7D4-C9B2F084B806/Worms2iPhone.app
sstyle is offline   0 Reply With Quote
Old Feb 13, 2011, 02:14 AM   #22
superjoyce
macrumors newbie
 
Join Date: Feb 2011
sort

Quote:
Originally Posted by sidewinder View Post
Okay, spaces in directory and file names causes gawk some issues. So we need to do something like this:

find / -name "*" -ls | sort -rn -k 7.1 | gawk 'BEGIN {OFS="\t"} {print $7,$11 " " $12 " " $13 " " $14 " " $15}' > files.txt

This will handle up to 4 spaces in the full path and name. That should be enough to figure out just about any file name. This will append 4 spaces onto file names that have no spaces in their path or name. But that shouldn't be too big of a deal.

S-
where can i find the sort command?
superjoyce is offline   0 Reply With Quote
Old Feb 13, 2011, 02:32 AM   #23
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by superjoyce View Post
where can i find the sort command?
/usr/bin/sort

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2
sidewinder is offline   0 Reply With Quote
Old Feb 13, 2011, 02:41 AM   #24
sidewinder
macrumors 68020
 
sidewinder's Avatar
 
Join Date: Dec 2008
Location: Northern California
Quote:
Originally Posted by sstyle View Post
I think size of folders more helpful instead files.
To be useful, you would need to use this command so you get files as well as directories and have them sorted:

du -a / | sort -rn > files.txt

This lists directories and files so it makes it harder to find the big files. But it does show the "*.app" directories as single entities so that is useful.

S-
__________________
Mac Pro: 8-core 2.8 GHz, 10GB RAM, OS X 10.8.4; iPhone 5 32GB iOS 6.1.2

Last edited by sidewinder; Feb 13, 2011 at 01:36 PM.
sidewinder is offline   0 Reply With Quote
Old Mar 7, 2011, 04:22 AM   #25
emonty
macrumors newbie
 
Join Date: Jan 2011
Great tip, freed up 5 GB of useless data, thank you!!!
emonty is offline   0 Reply With Quote

Reply
MacRumors Forums > iPhone, iPod and iPad > iOS > Jailbreaks and iOS Hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Here you find the best game on iPhone! Check now! net4winner iPhone and iPod touch Apps 1 Jun 18, 2011 09:01 AM
Where is the airplay button on iphone 4?? shriksworld iPhone 1 Nov 23, 2010 12:51 AM
Help finding an application that finds the largest files on your hard drive? niemo810 Mac Applications and Mac App Store 3 Mar 9, 2010 03:13 PM
Can't find the IPSW file for iphone jailbreak SonicCable Jailbreaks and iOS Hacks 8 Nov 27, 2009 10:52 PM
Finding largest files on my Computer MacFan25863 Mac OS X 10.3 (Panther) Discussion 5 Nov 24, 2004 04:45 PM


All times are GMT -5. The time now is 08:07 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC