Practical Linux commands, not the most comprehensive but practical --- disk usage du, DF

Source: Internet
Author: User
Tags disk usage

Command:

DF-H

Output instance:

File System capacity used available % mount point

/Dev/md0 9.7g 4.7G 4.6g 51%/
/Dev/sda5 9.7G 45 m 9.1g 1%/boot
/Dev/sda8 9.9g 43 m 9.3g 1%/home
None 1.8g 0 1.8g 0%/dev/SHM
/Dev/sda9 23g 3.8g 18g 18%/usr
/Dev/sda7 4.9g 2.6G 2.1g 57%/var
/Dev/sdb1 267g 131G 123g 52%/oradata

Explanation:

DF outputs the capacity of each partition of the hard disk. The-h Parameter indicates that the disk is output in a friendly format. For example, the Unit is GB rather than block.

 

Command:

Du-h-a -- Max-depth = 1/var/log

Output instance:

4.0 K/var/log/lkst
44 K/var/log/wtmp
5.0 m/var/log/messages.1
0/var/log/secure.1
88 K/var/log/ksyms.2
0/var/log/spooler.1
8.0 K/var/log/cups
4.0 K/var/log/canna
4.0 K/var/log/vbox
4.0 K/var/log/httpd
2.0 m/var/log/SA
4.0 K/var/log/mail
72 K/var/log/cron.1
0/var/log/pgsql
4.0 K/var/log/ProFTPD
4.0 K/var/log/squid
8.0 K/var/log/samba
4.0 K/var/log/uucp
144 K/var/log/rflogview
120 K/var/log/messages
4.0 K/var/log/cron
12 k/var/log/dump
20 k/var/log/dmesg
88 K/var/log/ksyms.0
0/var/log/secure
4.0 K/var/log/maillog
0/var/log/Spooler
4.0 K/var/log/boot. Log
4.0 K/var/log/oracle. Log
88 K/var/log/ksyms.1
7.7 M/var/log

Explanation:

View the file and folder size in A/var/log directory. -A not only displays subdirectories, but also files.-H outputs in a friendly format. -- Max-depth = 1 only outputs first-level subdirectories and files.

Command:

DF-I

Output instance:

File System capacity used available % mount point

/Dev/md0 1281696 104213 1177483 9%/
/Dev/sda5 1281696 51 1281645 1%/boot
/Dev/sda8 1310720 546 1310174 1%/home
None 467344 1 467343 1%/dev/SHM
/Dev/sda9 3025120 125944 2899176 5%/usr
/Dev/sda7 640000 639822 178 100%/var
/Dev/sdb1 35553280 49612 35503668 1%/oradata

Explanation:

DF outputs the number of nodes in each partition of the hard disk. -I indicates the node status. Note: according to the above command, we can see that the disk space in the/dev/sda7 partition is still 43%, but the number of nodes is almost ready for use. In this case, you must delete useless small files in time. Otherwise, the disk space is available, but the number of nodes cannot be used up to create new files.

 

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.