In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to check whether the folder is empty by linux". Friends who are interested may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "linux how to check whether the folder is empty".
In linux, you can use the du command to see if the folder is empty, which is used to display the disk space occupied by the specified directory or file. When the parameter is set to "- s", you can display the total size of the folder with the syntax "du-s folder".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How to check if the folder is empty by linux
The Linux du (English spelling: disk usage) command is used to display the size of a directory or file.
Du displays the disk space occupied by the specified directory or file.
Grammar
Du [- abcDhHklmsSx] [- L] [- X] [--block-size] [--exclude=] [--max-depth=] [--help] [--version] [directory or file]
Parameter description:
-an or-all displays the size of individual files in the directory.
-b or-bytes displays the directory or file size in byte.
-c or-- total displays not only the size of individual directories or files, but also the sum of all directories or files.
-D or-- dereference-args displays the source file size of the specified symbolic link.
-h or-- human-readable is in the unit of KMagazine GetWord ("G"); to improve the readability of information.
The parameters of-H or-- si are the same as-h, but the conversion unit of K _ ~ ~ M ~ G is 1000.
-k or-- kilobytes is in units of 1024 bytes.
-l or-- count-links repeats the hardware connection file.
The source file size of the symbolic link specified in-L or-- dereference display options.
-m or-- megabytes is in 1MB.
-s or-- summarize displays only totals.
When-S or-- separate-dirs displays the size of an individual directory, it does not include the size of its subdirectories.
-x or-- one-file-xystem is based on the file system at the beginning of the processing, and will be skipped in case of other different file system directories.
-X or-- exclude-from= is in the specified directory or file.
-- exclude= skips the specified directory or file.
-- ignore directories whose max-depth= exceeds the specified number of layers.
-- help displays help.
-- version displays version information.
Example
Show the space occupied by a directory or file:
At this point, I believe you have a deeper understanding of "linux how to check whether the folder is empty". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.