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 View disk Partition Space in Linux system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This "Linux system how to view disk partition space" article, the article sample code introduction is very detailed, with a certain reference value, interested friends must refer to, for the "Linux system how to view disk partition space", Xiaobian sorted out the following knowledge points, please follow the pace of the editor step by step slowly understand, then let us enter the topic.

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 (/).

The following is an explanation of the relevant commands:

Df-hl to check the remaining disk space

Df-h to view the partition size of each root path

Du-sh [directory name] returns the size of the directory

Du-sm [folder] returns the total number of megabytes in the folder

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

Df-help

Du-help

Check the size of the linux file directory and the number of files contained in the folder

Count the total size

Du-sh xmldb/

Du-sm * | sort-n / / count the current directory size and sort it

Du-sk * | sort-n

Du-sk * | grep guojf / / look at the size of a person

Du-m | cut-d "/"-f 2 / / look at the text before the second / character

Check how many files there are in this folder / * how many files

Du xmldb/

Du xmldb/* | wc-l

40752

Explanation:

Wc [- lmw] parameter description:

-l: how many lines

-m: how many characters

-W: how many words

1. Use the find command to find files that take up a lot of space

Find /-type f-size + 5G-find files larger than 5G, which can be used if you have work permission

Find. -type f-size + 10000k to find files larger than 10m

Find-type f-size + 500k-and-size-1000k-find files with sizes between 500KB and 1000KB:

two。 Commands for querying large files and files

Du-sh / * query all file sizes in the root directory

Df-I check the amount of space left

Df-h to check the amount of space left

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

The above is all the contents of the article "how to check disk Partition Space in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Development

Wechat

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

12
Report