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. To get the most from the tutorials in this series, you should have a basic knowledge of Linux and a working Linux system on which you can practice the. 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 first way is to use the date command. 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.Ģ. There are a few different ways to check the time on your Linux machine. 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. The gnome-disks application is part of gnome-disk-utility package in CentOS/RHEL/Fedora. Check disk type (HDD or SSD) Method 1: Check if the disk is rotational. You are interested in Power-On Hours row. You can use any directory with contents on your system to try these commands.ġ. If you prefer graphical application, you can read SMART data using Disks ( gnome-disks ), where you navigate to your disk, click on the menu and select SMART Data and Self-tests option. ![]() In the following examples we have used our Music directory which contains 3 subdirectories containing mp3’s. For example, an HDD may have a mean time between failures of 300,000 hours, while an SSD might have 1.5 million hours. The du command is useful for this and works in a similar way to the df command we looked at earlier. Often we might simply want to check how much room a file or directory is using.
0 Comments
Leave a Reply. |