Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check hard disk size in linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How do I check the hard disk size in the linux system? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

The way to check the disk space under the Linux system is: you can view it through the df-h command, and the df command is to view the system files in terms of disk partitions plus parameters to view the information of the remaining disk space.

View disk space size command

Df-h

The Df command means that the linux system views the file system in terms of disk partition, and you can add parameters to view the information of the remaining disk space. The command format:

Df-hl

The display format is:

File system capacity used available used% mount point

Filesystem Size Used Avail Use% Mounted on

/ dev/hda2 45G 19G 24G 44% /

/ dev/hda1 494m 19m 450m 4% / boot

/ dev/hda6 4.9G 2.2G 2.5G 47% / home

/ dev/hda5 9.7G 2.9G 6.4G 31% / opt

None 1009M 0 1009M 0% / dev/shm

/ dev/hda3 9.7G 7.2G 2.1G 78% / usr/local

/ dev/hdb2 75G 75G 0 100% /

/ dev/hdb2 75G 75G 0 100% /

Taking the output above as an example, it means:

The second hard disk (b) of the HD hard disk interface, the second partition (2), has a capacity of 75g, uses 75G, and the availability is 0, so the utilization rate is 100%, which is mounted to the root partition directory (/).

Interpretation of relevant orders

Df-hl View disk remaining space df-h View the partition size of each root path du-sh [directory name] return the size of the directory du-sm [folder] return the total M of the folder du-h [directory name] View all file sizes under the specified folder (including subfolders)

For more functions, you can enter the command to view:

Df-help

Du-help

Other featur

View the partition of the hard drive # sudo fdisk-l

View IDE hard disk information # sudo hdparm-I / dev/hda

View STAT hard disk information # sudo hdparm-I / dev/sda or # sudo apt-get install blktool # sudo blktool / dev/sda id

Check the remaining space on the hard drive # df-h # df-H

View directory footprint # du-hs directory name

Cannot uninstall # sync fuser-km / media/usbdisk on USB disk

After reading the above, have you mastered the method of how to check the hard disk size in the linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report