What does the du command display in UNIX?

What does the du command display in UNIX?

a) Disk usage of files and directories
b) List of open files
c) User information
d) CPU usage

Answer:

a) Disk usage of files and directories

Explanation:

The du (disk usage) command in UNIX is used to estimate the disk space used by files and directories. By default, it shows the disk usage for each file and subdirectory in the specified directory. It can be useful when trying to identify large files that are taking up space.

For example, running du -h will display the output in a human-readable format, such as KB, MB, or GB. This helps in better understanding the amount of space occupied by files and directories on the system.

Knowing how to use du allows administrators to manage disk space more effectively, ensuring that unnecessary files are removed and systems do not run out of storage space unexpectedly.

Reference:

Top 50 Unix MCQ Questions & Answers

Scroll to Top