du Command Output In Human Readable Format ( GB / MB / TB )

www.la‮c.iruttu‬om
du Command Output In Human Readable Format ( GB / MB / TB )

To display the output of the du command in a human-readable format, such as GB, MB, or TB, you can use the -h option.

This option tells du to display the sizes of files and directories in a "human-readable" format, which means that the sizes are displayed in a more readable format such as "1K", "2M", or "3G", rather than in bytes.

For example, to display the sizes of the files and directories in the current directory in a human-readable format, you can use the following command:

du -h

This will display the sizes of the files and directories in the current directory, with each size followed by a letter that indicates the unit of measurement: "K" for kilobytes, "M" for megabytes, "G" for gigabytes, and so on.

You can also use the --si option to display the sizes in the International System of Units (SI) prefixes, such as "k" for kilo-, "M" for mega-, and "G" for giga-. For example, to display the sizes in the current directory in SI prefixes, you can use the following command:

du --si

You can also use the -c option to display the total size of all the files and directories in the current directory, as well as the sizes of each individual file and directory. For example, to display the total size of the files and directories in the current directory in a human-readable format, you can use the following command:

du -ch

This will display the total size of the files and directories in the current directory, followed by a list of the sizes of each individual file and directory.

You can use other options with du to specify the depth of the search, exclude certain files or directories from the search, or display the sizes in a different format. For more information about the options available with du, you can consult the du man page or use the man du command to see the manual page.

Created Time:2017-10-28 14:02:29  Author:lautturi