Contents
What unit does du return?
du computes file space in units of 512 bytes. The actual disk space used by files and directories may be more, since some systems allocate space in units of some multiple of a sector. On UNIX System V, it is usually two sectors; on UNIX Version 7, it is one sector.
What is du mean in Linux?
disk usage
du (abbreviated from disk usage) is a standard Unix program used to estimate file space usage—space used under a particular directory or files on a file system.
How do I find the directory and subdirectory size in Linux?
Display the size of one or more directories, subdirectories, and files by using the du command. Sizes are displayed in 512-byte blocks. Displays the size of each directory that you specify, including each subdirectory beneath it.
What does Sudo du mean?
The general syntax for the du command is as follows: In this situation, you’ll need to prepend the command with sudo . du has lots of options, we’ll outline just the most frequently used ones. The -a option tells du to report the disk space usage of each file within the directory.
Why does du report less than the expected sum?
Sometimes du reports less than the expected sum. This happens if there are hard links inside the directory tree: du counts each file only once. On some file systems like ZFS on Linux, du does not report the full disk space occupied by extended attributes of a file.
How to check the size of a directory?
The Windows dir directory listing command has a line at the end showing the total amount of space taken up by the files listed. For example, dir *.exe shows all the .exe files in the current directory, their sizes, and the sum total of their sizes.
Why do I need to run du on a directory?
When you run du on a directory, it sums up the disk usage of all the files in the directory tree, including the directories themselves. A directory contains data (the names of the files, and a pointer to where the file’s metadata is), so it needs a bit of storage space.
How to show sum of file sizes in directory listing?
Two components of output, col 1 represented by the numeric values: 836544, 934364… etc, and col 2 being the path of the file. However, since there are two lines that do not match what we want – icon_zip.gif and import_from_zip_file.php – we want to exclude these.