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

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

Share

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

How do I view disk usage in linux? 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.

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 directory or file information 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:

Du-sh python3

As the result is shown in the following figure, you can directly see that the size of this directory is 206m, and 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.

After reading the above, have you mastered how to view disk usage in linux? 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