<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<?xml-stylesheet type="text/css" href="http://linuxevolution.org/styles/feed.css"?>


<title type="html">Filed under: iPhone | Linux Evolution dot org and the NSLU2</title>
<subtitle type="html"></subtitle>
<link rel="alternate" type="text/html" href="http://linuxevolution.org"/>
<link rel="self" type="application/atom+xml" href="http://linuxevolution.org/archives/iphone/index-atom.xml"/>
<updated>2010-12-26T18:50:23-05:00</updated>
<author>
<name>orvtech</name>
<uri>http://linuxevolution.org</uri>
</author>
<id>http://linuxevolution.org/</id>
<generator uri="http://nanoblogger.sourceforge.net" version="3.4">
NanoBlogger
</generator>

<entry>
<title type="html">Find the biggest file or folder inside a directory.</title>
<author>
<name>orvtech</name>
</author>
<link rel="alternate" type="text/html" href="http://linuxevolution.org/archives/2010/05/18/find_the_biggest_file_or_folder_inside_a_directory/index.html"/>

<id>http://linuxevolution.org/archives/2010/05/18/find_the_biggest_file_or_folder_inside_a_directory/index.html</id>
<published>2010-05-18T10:57:05-05:00</published>
<updated>2010-05-18T10:57:05-05:00</updated>
<category term="OneLiners" />
<category term="Scripts" />
<category term="NSLU2" />
<category term="Linux" />
<category term="iPhone" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
By using the `du` command we can find the biggest file or directory inside a folder. The next example shows how to list the 10 most biggest files and floders inside 'HOME'
</p>

<pre>du -a ~/ | sort -n -r | head -n 10</pre>

<br />

<p>
If we use the `find` command we can list the 10 biggest files inside a directory, even if they are inside sub-folders.
</p>

<pre>find ~/ -type f -exec ls -ls {} \; | awk '{print $6"\t"$9}' | sort -k1 -n -r | head -n 10</pre>
</div>
</content>

</entry>

</feed>

