How to Run the Disk Usage (DU) Command for One Level Only?
If you want to execute the disk usage (du) command for one level only, then you can make use of any of the following two methods:
Method # 1: By using the “max-depth” Option:
For this method, you will have to execute the command stated below:
This command will display the disk usage of the hard disk of your system only up to the first level, as shown in the following image:
Method # 2: By using the “d” Flag:
This method is just an alternative to the method discussed above. To follow it, you will have to execute the command shown below:
Again, the above-mentioned command will show the disk usage of the hard disk of your system for one level only, as shown in the following image:
In both of these methods, we have used the “-h” flag to display our output in a human-readable format.
Conclusion:
By picking either of the two methods explained in this tutorial, you can instantly manage to run the disk usage (du) command up to the first level only.