This flag was incredibly useful to me as a storage admin. It shows the time of the last modification to any file in the directory or subdirectory that you run it against. article_submissions]$ du -ah /home/tcarrigan/article_submissions/Ĩ.0K /home/tcarrigan/article_submissions/my_articles/Creating_physical_volumesĤ.0K /home/tcarrigan/article_submissions/my_articles/Creating_volume_groupsĤ.0K /home/tcarrigan/article_submissions/community_content/articleĤ.0K /home/tcarrigan/article_submissions/community_content/article2Ĥ.0K /home/tcarrigan/article_submissions/community_content/article3Ĥ.0K /home/tcarrigan/article_submissions/community_content/article4ġ2K /home/tcarrigan/article_submissions/community_content/real_sysadminsĨ.0K /home/tcarrigan/article_submissions/community_content/podman_pulling Notice the individual file sizes are listed with the directories. The -a option is often combined with the -h flag for ease of use. It lists the sizes of all files and directories in the given file path. This helpful option does exactly what you would think. If that output seems familiar, its because its an exact copy of the last line of the -h output. article_submissions]$ du -sh /home/tcarrigan/article_submissions/ Instead, they allow us to get a summary of the directory's usage in a human-readable format. With their powers combined, they do not become an eco-friendly demi-god. The -s flag is added to the -h flag on occasion. article_submissions]$ du -h /home/tcarrigan/article_submissions/ġ2K /home/tcarrigan/article_submissions/my_articlesģ6K /home/tcarrigan/article_submissions/community_content If we now run the du -h command on the same directory, we see that the 12, 36, and 48 values are in KB. This format provides a unit of measure (Bytes). The -h flag prints size outputs, such as the ones above, in a human-readable format. Here is where the options become necessary. There is no indication as to what unit of measure is being used with the standard command, making this output less than useful. The bottom row is a summary of the entire /home/tcarrigan/article_submissions directory. The values on the far left are the disk usage, followed by the specific directory responsible for that usage. You can see that there are three lines of output given by the basic command. article_submissions]$ du /home/tcarrigan/article_submissions/ġ2 /home/tcarrigan/article_submissions/my_articlesģ6 /home/tcarrigan/article_submissions/community_content Let's first look at the standalone command, and then add in various options. The aim here is to introduce the basic flags that people use, but also to look at some that are less common in hopes of improving our use of du. Also, like many Linux commands, most users only use the same two or three flags to meet their specific set of needs. It is best applied to specific directories and allows many variations for customizing the output to meet your needs.Īs with most commands, the user can take advantage of many options or flags. The du command is a standard Linux/Unix command that allows a user to gain disk usage information quickly. How well do you know Linux? Take a quiz and get a badge.Linux system administration skills assessment.A guide to installing applications on Linux.Download RHEL 9 at no charge through the Red Hat Developer program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |