How Do You Check What Is Using Your Disk Space in Linux?

Unison

Well-known member
VIP

How Do You Check What Is Using Your Disk Space in Linux?​

One thing that can catch you out in Linux is a drive gradually filling up without it being obvious what's using the space.

A simple command I've been using is:

df -h

That gives a quick overview of the drives and filesystems and shows how much space is used and available.

If one is getting full, you can then start looking at which directories are actually using the space rather than deleting things at random.

I'm still learning the different Linux tools for this, so I'm interested in what everyone else uses.

What's your preferred way of finding what's taking up disk space on Linux?
 

How Do You Check What Is Using Your Disk Space in Linux?​

One thing that can catch you out in Linux is a drive gradually filling up without it being obvious what's using the space.

A simple command I've been using is:

df -h

That gives a quick overview of the drives and filesystems and shows how much space is used and available.

If one is getting full, you can then start looking at which directories are actually using the space rather than deleting things at random.

I'm still learning the different Linux tools for this, so I'm interested in what everyone else uses.

What's your preferred way of finding what's taking up disk space on Linux?
df -h | grep G

Or something similar will work, depends what you're trying to do. Learn to use grep as it'll make life easier.

| is a pipe command, and allows you to use multiple commands in the same line, it's a delineator I guess.

Find out the disc space, then cat into that filesystem, then ls -lhr to list what's in the system, then cat into that if you want or use rm -(file) to remove it.
 

How Do You Check What Is Using Your Disk Space in Linux?​

One thing that can catch you out in Linux is a drive gradually filling up without it being obvious what's using the space.

A simple command I've been using is:

df -h

That gives a quick overview of the drives and filesystems and shows how much space is used and available.

If one is getting full, you can then start looking at which directories are actually using the space rather than deleting things at random.

I'm still learning the different Linux tools for this, so I'm interested in what everyone else uses.

What's your preferred way of finding what's taking up disk space on Linux?
The one I generally used was this one :-
df -H --output=source,size,used,avail

But I also used genarally :- Disk Usage Analyser (in Administration Menu) this also picks up my Emby Drive on network so I know where I am with that one.
 
The one I generally used was this one :-
df -H --output=source,size,used,avail

But I also used genarally :- Disk Usage Analyser (in Administration Menu) this also picks up my Emby Drive on network so I know where I am with that one.
Thanks, I've just tried that command on my Manjaro system:

df -H --output=source,size,used,avail

I can see why you use it. It gives a nice clean overview without the extra information. My main Manjaro partition is showing 983GB total, 70GB used and 864GB available, so plenty of room at the moment.

I haven't tried Disk Usage Analyser yet, so I'll have a look at that as well. It's useful learning both the terminal commands and the graphical tools. 👍
 
Back
Top