Dave's Brain

Browse - computer tips - root du

Date: 2008sep27
OS: Linux

Q.  My root partition is nearly full how can I tell what's taking up the root?
If I do "du /" I get things that are not in the root partition

A.  I use this small script (called root_du) to filter out directories that
are not in the root partition:

	#!/bin/sh

	DISK=`df / | tail -1 | awk '{print $1}'`

	for I in /*; do
		if df $I | grep -q $DISK; then
			du -sh $I
		fi
	done
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: