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 disk usage in Linux system

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

Share

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

This article, "how to check disk usage in the Linux system", the sample code in the article is very detailed and has a certain reference value. Friends who are interested must refer to it. For "how to check disk usage in the Linux system", Xiaobian sorted out the following knowledge points, please follow the pace of Xiaobian step by step to understand it step by step, and then let's get into the topic.

1. Use the df command to view the overall disk usage. The df command is used to view the mount point of the hard disk and the corresponding hard disk capacity information. Including the total size of the hard drive, the size that has been used, and the remaining size. And the percentage of space used.

The most commonly used command format is:

Df-h or use:

Df-lh output:

Filesystem refers to the hardware device files on the system, and Size refers to the total size of the hard disk or partition. Used represents the size that has been used, and Avail represents the size that can be used. Use% represents the percentage of space that has been used. The final mounted on indicates the directory in which the hard drive is mounted.

Description: parameters that can be added after the df command

●-a: lists all file systems, including system-specific / proc and other file systems

●-k: displays file systems in the capacity of KB

●-m: displays each file system in the capacity of MB

●-h: display itself in GB,MB,KB and other formats that are easy for people to read

●-H: replace the carry mode of MIMO 1024K with MIMO 1000K

●-T: displays the file system type

●-I: not the hard disk capacity, but the number of inode

●-l: show only native file systems

2. Use the du command to view the usage of the specified directory. Du command to view the information of the directory or file inside the hard disk. Du commands usually need to be executed followed by arguments, and the general format is:

Du option File/directory for example, if I want to check the capacity of the python3 directory under the current directory, the command is:

As the du-sh python3 result is shown in the following figure, you can directly see that the size of this directory is 206m. If it is not followed by a file name or directory name, the size of the current directory will be displayed.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

The above is all the contents of the article "how to check disk usage 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