How to Manage disk space in UNIX or Linux?

Being a UNIX user or Administrator no matter how many disks you added to your system , it has been always be a scramble for space. Users sometimes forget to remove the unused files/data from their system due to which the system disk gets eaten up by the unused files. Which makes the system slow. In this tutorial i will discuss about the most powerful and helpful commands df and du. By which you can manage your system disk usage as a user and administrator as well.

Sometimes those who are new to UNIX like operating system, gets confused between df and du command. And how and where to use those commands, so now let us discuss how those commands can be used.

du — Disk Usage

This command is helpful to find out the consumption of a specific directory tree from your file system rather than the entire file system. By default, it helps to summarize disk space used for each FILE and/or directory.

Syntax:

The general syntax for du command is as below.

$ du [OPTIONS]… FILE…

df — disk free

This command reports free space in your Linux system, and df (disk free) command reports the available and used space for each file system separately.

Syntax:

The general syntax for df command is as below.

$ df [OPTIONS]… FILESYSTEM…

When df is used without any argument it will show the information about the complete mounted file system.

In this tutorial i have just explained very basic difference between df and du command in Linux. Hope this will clarify your doubts on the difference between these disk management commands. Please follow du and df command to get more in depth details.

One thought on “How to Manage disk space in UNIX or Linux?

Leave a Reply

Your email address will not be published. Required fields are marked *