In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to check disk space under Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
You can use the df and du commands to view disk space in Linux.
Df
Df looks at the file system in terms of disk partitions and can get information such as how much space the hard disk is occupied and how much space is left.
For example, we use the df-h command to view disk information, and the-h option displays appropriately according to size:
Display content parameter description:
Filesystem: file system Size: partition size Used: used capacity Avail: available capacity Use%: percentage used Mounted on: mount point
Related commands:
Df-hl: view the remaining disk 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 (including subfolders) under the specified folder du
The original meaning of du is disk usage, which means to show the use of disk space and is used to view the total size of the current directory.
For example, view the size of the current directory:
# du-sh605M
. Displays the space occupied by the specified file:
# du log2012.log300 log2012.log
An easy-to-read format shows the space occupied by the test directory:
# du-h test608K test/test6308K test/test44.0K test/scf/lib4.0K test/scf/service/deploy/product4.0K test/scf/service/deploy/info12K test/scf/service/deploy16K test/scf/service4.0K test/scf/doc4.0K test/scf/bin32K test/scf8.0K test/test31.3M test
The du command is used to view the total size of the current directory:
-s: only the total number of blocks occupied is given for each Names parameter. -a: recursively displays the number of data blocks occupied by each file in the specified directory and in each subdirectory. If neither-s nor-an is specified, only the number of disk blocks occupied by each directory and its subdirectories in the Names is displayed. -b: lists disk space usage in bytes (the system defaults to k bytes). -k: lists disk space usage in 1024 bytes. -c: finally, add a total (the system default). -l: calculate all file sizes, and for hard-linked files, calculate multiple times. -x: directories skipped on different file systems are not counted. -h: to improve the readability of the information in the unit of K _ (Magi) M _ (G).
The above is all the contents of the article "how to check disk space under Linux". 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.