In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to query folder size in Linux". In daily operation, I believe many people have doubts about how to query folder size in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to query folder size in Linux". Next, please follow the editor to study!
1.1 the df command df can view the first-level folder size, usage ratio, file system and its mount point, but there is nothing you can do with files. Du can view the size of files and folders.
The file system that can be used to view partitions
Df-T
The df command displays the free space and use cases of all current file systems
Df-h
1.2 du command / / View the usage of files in the system df-h / / View the space occupied by each file and directory under the current directory du-sh * / method 1: change to the directory to be deleted, delete all files in the directory rm-f * / method 2: delete all files under the logs folder Without deleting the folder itself, rm-rf log/*du: query the disk usage space of a file or folder
Quote paragraph if there are a lot of files and folders in the current directory, use the command without the parameter du to cycle through the space used by all files and folders. This is disadvantageous to see which place is too large, so you have to specify the number of layers in the deep directory, the parameter:-max-depth=, this is a very useful parameter!
As follows, pay attention to the use of "*" to get the size of the file space.
Reminder: for FreeBSD, which has always been more complex than linux, its du command specifies the number of layers in the deep directory is simpler than linux, which is-d. Du-h-max-depth=1 / home
What are the similarities and differences between the following command and the above command?
Answer: du-h-max-depth=1 / home lists only all the first-level directory file sizes under the home directory
Du-h-max-depth=1 / home/* lists the first-level directory file sizes for all first-level directories under home.
Du-h-max-depth=1 / home/*
Linux:ls views file sizes in K, M, G units
Note the use of the man command. Press the "Q" key to exit the man query.
At this point, the study on "how to query the folder size of Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.