If you’re a new user or student planning on learning how to use and manage Linux systems, the easiest place to start might be on Ubuntu Linux OS. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers, and other devices. When you’re ready to learn how to use the du commands, follow the guide below: About du command: The du command displays estimates of disk space used by files or directories on the Linux file system. If you want to know the space used by a particular directory or file in Ubuntu, use the du command. In the same way, you use your mouse and keyboard to view a file or directory size or what disk space is being used, du is the way to do it on the command line. Syntax: The syntax is the rule and format of how the du command can be used. These syntax options can be reordered, but a straight format must be followed.,. Below is an example syntax of how to use the du command. Options: The command line options are switches or flags that determined how the commands are executed or controlled. they modify the behavior of the commands. they are separated by spaces and followed after the commands. Below are some options for the du command: Examples: Below are some examples of how to run and use the du on Ubuntu Linux. If you want to view the /var directory size or how much space the /var directory is using on the disk, you run the commands below: If you want a human-readable format and to make sense of the data, you will want to run the du command with the -sh options. example: If you’re not logged in as root, then run sudo with the du command on directories that requires root access. You should see an output with just the size of the /var directory and how much space is being used by it. If you want to see sizes used by sub-directories inside of the /var directory. you can run the commands below: Or use the –max-depth=1 command option. That should display similar lines as below: You can also combine the du commands with other commands and pipes and display more accurate information. For example, to print out the 3 biggest directories in the /var directory. run the commands below: It should output something similar to the lines below: When you run du with the –help option, you’ll see the help text below: That’s it! Congratulations! You’ve learned how to use the du command to create and extract archives files. You may also like the commands below: