Bash shell commands and monitoring that point (iii)

Source: Internet
Author: User
Tags readable disk usage

BASH shell command and monitor the DF and du of that point

  The first two describes the bash Shell's process monitoring instructions, but sometimes you need to know how much disk space you have on a device. The DF command is introduced first:

DF command

The DF command is used to easily view the usage of all mounted disks:

1[Email protected] ~]#DF2Filesystem 1k-blocks used Available use%mounted on3/dev/sda239219648 10728028  26499380   in% /4Tmpfs1962216      528   1961688   1%/dev/SHM5/dev/sdb11050016    32928   1017088   4%/SRV/NODE/SDB1

  The DF command displays each mounted file system with data. The command output is as follows:

    • The device file location of the device;
    • How many blocks of 1024-byte size can be accommodated;
    • How many 1024-byte-sized blocks have been used;
    • How many 1024-byte size blocks are available;
    • Proportion of occupied space;
    • The device is attached to that mount point.

  The DF command has a common parameter of-H. It will display the disk space in the output in a human-readable manner, usually with m instead of megabytes, and G instead of the gigabyte:

1 DF -H2 Filesystem            Size  used Avail use% mountedon3 /dev/sda2              38G   11G   26G  4 tmpfs                 19G  528K  1 . 9G   1/dev/shm5 /dev/sdb1             1. 1G   33M  994M   4%/SRV/NODE/SDB1

The following describes the du command:

Du command

  The DF command makes it easy to see which disk is running out of storage space, so what happens when the problem comes up? Yes, that's the du command. The du command can display disk usage for a specific directory (by default, the current directory). This is a quick way to determine if you have a large file on your system.

By default, the du command displays disk usage for all files, directories, and subdirectories in the current directory. It shows how much storage each file or directory occupies, in blocks of disk. In the standard home directory, this output will be a long list. Here is a partial output of the du command:

1[Email protected] vim74]#du2  -./Libs3 272./Pixmaps4  -./nsis/icons5  -./NSIs6  -./runtime/macros/Maze7  -./runtime/macros/Hanoi8  -./runtime/macros/Urm9  -./runtime/macros/ LifeTen 248./runtime/Macros One 840./runtime/Ftplugin A  the./runtime/plugin - 5952./runtime/Syntax - 2120./runtime/Tutor the  -./runtime/Tools - 6592./runtime/doc

where each line of output starts is a numeric value, which is the number of disk blocks that each file or directory occupies. Note that the list starts at the bottom of the hierarchy of a directory, and then moves up by file, subdirectory, and directory.

The use of this is not very useful, here are a few parameters to make it easier for you to use the du command:

    • -C: Displays the total size of all listed files;
    • -H: Output file size according to human readable mode;
    • -S: Displays the total for each output parameter.

 This is the end of the Linux Bash Shell command for monitoring.

The other two can be seen here: the Bash shell command and the thing to monitor (a).

BASH shell command and monitor that point (ii).

Bash shell commands and monitoring that point (iii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.