---
title: "\"Disk Full\" error on a Linux server. How to identify which directory is consuming the most space?"  
description: "\"Disk Full\" error on a Linux server. How to identify which directory is consuming the most space?"  
author: "Revati S Misra"  
published: 2023-08-01  
updated: 2023-08-02  
canonical: https://www.mindstick.com/forum/159412/disk-full-error-on-a-linux-server-how-to-identify-which-directory-is-consuming-the-most-space  
category: "troubleshooting"  
tags: ["error", "linux", "troubleshooting"]  
reading_time: 2 minutes  

---

# "Disk Full" error on a Linux server. How to identify which directory is consuming the most space?

"[Disk](https://answers.mindstick.com/qa/96923/what-are-hard-disk-partitions) [Full](https://www.mindstick.com/articles/12893/experience-the-full-power-of-suitecrm)" [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) on a [Linux](https://www.mindstick.com/blog/11489/linux-os) server. How to [identify](https://www.mindstick.com/forum/159425/java-app-crash-arrayindexoutofboundsexception-identify-invalid-index) which [directory](https://www.mindstick.com/forum/226/how-to-get-application-directory-using-c-sharp-csharp) is consuming the most [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space)?

## Replies

### Reply by Aryan Kumar

If you are getting a disk full error on a Linux server, you can use the `du` command to identify which directory is consuming the most space. The `du` command stands for "disk usage", and it will show you the amount of space that is being used by each directory.

To use the `du` command, you will need to specify the directory that you want to get the disk usage for. For example, to get the disk usage for the `/var` directory, you would run the following command:

```plaintext
du -sh /var
```

The `-sh` option tells the `du` command to show the disk usage in human-readable format. The output of the command will show you the total amount of space that is being used by the `/var` directory, as well as the amount of space that is being used by each subdirectory.

You can use the `du` command to recursively scan a directory tree to find the directories that are consuming the most space. To do this, you will need to use the `-r` option. For example, to recursively scan the `/var` directory tree, you would run the following command:

```plaintext
du -sh -r /var
```

The output of the command will show you the total amount of space that is being used by the `/var` directory tree, as well as the amount of space that is being used by each subdirectory.

Once you have identified the directory that is consuming the most space, you can take steps to reduce the amount of space that it is using. For example, you can delete unnecessary files or move files to a different directory.

Here are some additional tips for identifying which directory is consuming the most space on a Linux server:

- **Use the** `du` **command with the** `-h` **option.** The `-h` option will show you the disk usage in a more human-readable format.
- **Use the** `du` **command with the** `-x` **option.** The `-x` option will exclude directories that are hidden.
- **Use the** `du` **command with the** `-S` **option.** The `-S` option will summarize the disk usage for all of the directories in a directory tree.


---

Original Source: https://www.mindstick.com/forum/159412/disk-full-error-on-a-linux-server-how-to-identify-which-directory-is-consuming-the-most-space

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
