Syntax of `du` command in Linux
The basic syntax of the du
command is as follows:
du [options] [directory/file]
Here,
[options] = various flags that modify the behavior of the command
[directory/file] = the target directory or file for which disk usage information is desired. If no directory or file is specified, du will default to the current directory.
Example:
du /home/mandeep/test
Output:
44 /home/mandeep/test/data
2012 /home/mandeep/test/system design
24 /home/mandeep/test/table/sample_table/tree
28 /home/mandeep/test/table/sample_table
32 /home/mandeep/test/table
100104 /home/mandeep/test
du command in Linux with examples
The `du`
command in Linux is a powerful utility that allows users to analyze and report on disk usage within directories and files. Whether you’re trying to identify space-hogging directories, manage disk space efficiently, or simply gain insights into storage consumption, the du
command provides valuable information. In this article, we’ll explore the du
command, its basic syntax, and various examples to demonstrate its functionality.