BM Balmiki Mandal 04 May 2023 2 views 0 comments Linux

Understanding 'DU' Command in Linux

What is DU Command in Linux?

The DU Command (Disk Usage) is a Linux command used to view the amount of disk space a file or directory is taking up. By providing a summary of disk space used, it helps users manage their storage resources by showing them which directories are taking up the most space, so they can easily identify areas for cleaning or optimization.

How to Use DU Command in Linux?

The DU command is used in the following format:

du [options] [directories/files]

Where the options are optional and the directories/files are the names of the directories or files that you want to examine. Here's an example of a DU command:

du -a /var/www

This command will list all the files and directories in the /var/www folder and display their size in bytes. This information can be useful when trying to spot large files or directories that are taking up unnecessary space.

What are Some Commonly Used Options with DU Command?

  • -a - Displays all files and directories.
  • -h - Displays sizes in human-readable format (in kilobytes, megabytes, etc).
  • -s - Displays only the total size of the directory or file.
  • -S - Displays the total size of each directory.
  • -c - Displays the grand sum of all sizes.
  • -x - Skips directories on other filesystems.

Conclusion

The DU command is a powerful tool for managing disk space on Linux systems. It can help users identify which files and directories are taking up the most space. By supplying options, users can further customize the command to better suit their needs.

0 Comments

No comments yet, Be the first to comment.

Post a Comment

Please sign in to post a comment.

Related Posts

How to Create an Embedded Linux Development Environment on Windows Using WSL2

 Creating an Embedded Linux Development Environment on Windows Using WSL2If you are learning Embedded Linux, y...

AG Anvesh G 05 Sep 2026
Installing Ubuntu OS in Window Using VirtualBox

Installing Ubuntu on Windows Using VirtualBoxSteps:-1. Download and Install VirtualBox Download VirtualBox fr...

BM Balmiki Mandal 18 Jan 2025
Kali Linux 2021.4, Apple M1 support, armhf, arm64, Electro4u

Kali Linux 2021.4 Brings Improved Apple M1 Support Kali Linux, the world’s premier open-source penetration te...

BM Balmiki Mandal 06 Jun 2023