23.3 C
Texas
Muhammad Nabeel
Network and System Administrator

du command to Check file/folder disk usage in Linux

Linux du (Disk Usage) is a Unix/Linux command. It used to check disk usage of files and directories on Linux system. There are many options of du commands to get different outputs which we use in below examples.

Check Directory Disk Usage Summary

So, below command is used to get the summary of disk usage of /boot directory. Its also unclude sub-directory summary.

du /boot
disk usage summary of /boot directory.

If you want to see a grand total disk usage of a directory, use below command where / should be your desired directory name.

- Advertisement -
du -s /boot
See only grand total space using by /boot directory.

Check disk usage in human readable form

Now we will see disk usage of /boot directory in human readable from with grand total.

du -hs /boot
Check grand total disk usage space of /boot directory in human readable form.

Check Disk Usage of Directories with files.

what if you wanna see that how much space is using by both, files and folders. to check that simply run below command

du -ah /boot

See Disk usage with Time

If you want to see total usage of a directory with it last modification time and date, then run following command

du -h --time /boot

Show disk space usage in KB

Simply run below command to see disk usage of a directory in kilobytes

du -k /boot

List space Usage in MB

du -mh /boot

Read manual pages using command “man du” for more information.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article