Find larger file that are consuming disk space in Linux | Sys Admin

While handling over the linux server we many time come across disk issue, below are few method which we can use.

login as root user:


Method1:
To find file which are greater than 1 GB.

find / -xdev -type f -size +1G -exec ls -lrth {} \;

you can change the file limit as you need.


Method2:

cd /
du -s -h -x * | sort -n | tail -10

Method3:

cd /
for i in G M K; do du -ah | grep [0-9]$i | sort -nr -k 1; done | head -n 11

Method4:

find / -xdev -printf '%s %p\n'| sort -nr | head -10

Method5:

cd /
for i in G M K; do du -xah | grep [0-9]$i | sort -nr -k 1; done | head -n 11

Method6:

start from  slash if above above methods are taking much more time.use simple du command

cd /
du -sh | grep G

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s