Difference between revisions of "Du"

From DevOps Notebook
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== find top 10 largest directories ===
+
== Find top 10 largest directories ==
 
<pre>
 
<pre>
# du -hs * | sort -rh | head -5
+
# du -hs * | sort -rh | head -10
 +
</pre>
 +
 
 +
== Exclude from disk usage ==
 +
<pre>
 +
# du -ah --exclude="*.txt" /home/devops
 +
</pre>
 +
 
 +
== Display disk usage based on modification time ==
 +
<pre>
 +
du -ha --time /home/devops
 
</pre>
 
</pre>

Latest revision as of 12:20, 7 December 2019

Find top 10 largest directories

# du -hs * | sort -rh | head -10

Exclude from disk usage

# du -ah --exclude="*.txt" /home/devops

Display disk usage based on modification time

du -ha --time /home/devops