With the addition of our suggested arguments, these commands are ready to to be part of your sysadmin toolkit. At the basic level, each command gives you the information that you need. No matter if you are a relative newcomer or a seasoned sysadmin, both commands are absolutely essential for the smooth running of your Linux machines. The df and du commands are deceptively simple but immensely powerful. This can be a relative path, from our current location, or an absolute path. Similar to other linux commands we don’t always need to run the du command from within the target directory, rather we can specify a path to a target directory. If we just want to know the total size of the directory and its subdirectories, adding -s as an argument will return just the total. Simplify the output to just show the total directory size. Add the -h argument to make du return results in megabytes and gigabytes. The output of this command is quite straightforward: it lists the size of each sub directory and then the name and then finally on the last line returns the sum of all the subdirectory sizes to give the directory disk usage.Ģ. Note that similar to the df command, in its standard form the du command returns values in kilobytes. Move to a directory, list its contents and then check disk usage. You can use any directory with contents on your system to try these commands.ġ. In the following examples we have used our Music directory which contains 3 subdirectories containing mp3’s. The du command is useful for this and works in a similar way to the df command we looked at earlier. This application is launched on a powerful Linux server. Often we might simply want to check how much room a file or directory is using. I am currently studying the performance of an Java application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |