![]() These are the ways I typically use the command, so find your favorite options and start gathering data about your system. It's a good idea to use the df command regularly to monitor usage on critical mount points. You can read about the available field options on the info page and the man page. For instance, suppose you don't want to see the size or amount of disk used: $ df -h -output=source,avail,pcent,target If you want different output, you can customize the fields. su - Step 2: List the hard drives attached to your Linux PC with the lsblk command. The examples I've demonstrated so far have the same columns in the output. Step 1: Open up a terminal and gain a root shell with su or sudo -s. Run the lsblk command as follows to lists information about all available or the specified block devices: lsblk. You can also run df on a specific mount point: $ df -h / Using lsblk command to find out Linux hard disk information. ![]() Get disk space available on a specific mount If you want to omit all mount points except for the total, use grep alongside a regular expression with ^ to search for the total at the start of a line: $ df -h -total|grep ^total You can use this option when all mounted filesystems are on the same disk, whether physical or virtual: $ df -h -total To omit entries that aren't essential to available space and get a total, use the -total option. To show inode (or index node) use on each mounted filesystem, use -inodes ( -i for short): $ df -ihįilesystem Inodes IUsed IFree IUse% Mounted on If you want to run df in its human-readable format, use the -human-readable ( -h for short) option: $ df -hįilesystem Size Used Avail Use% Mounted on Lists of long numbers (as shown above) can be difficult to parse. In this post, we shall focus on five best methods, which include both Graphical and command-line methods. Disk space is shown in 1K blocks by default: $ dfįilesystem 1K-blocks Used Available Use% Mounted on There are several ways which you use to check and analyze the disk usage in your Ubuntu system. If you don't include a file name, the output shows the space available on all currently mounted filesystems. The df command primarily checks disk usage on a mounted filesystem. Like many Linux commands, df uses the following structure: df. This article discusses how to use the df command. You might also be interested in my article Make du's output more useful with this neat trick. ![]() The df command displays the amount of disk space available on the filesystem with each file name's argument.įor a good overview of the du command, read Tyler Carrigan's article Linux commands: du and the options you should be using. While du reports files' and directories' disk usage, df reports how much disk space your filesystem is using. Two related commands that every system administrator runs frequently are df and du.
0 Comments
Leave a Reply. |