In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will introduce in detail "what is the command for the Linux system to check the number of files under the folder". The content steps are clear and detailed, and the details are handled properly, and the editor updates different knowledge points every day. I hope this article "what is the command for Linux system to check the number of files under the folder" will give you unexpected gains. Please follow the editor's ideas slowly and deeply. The details are as follows. Let's go and gain new knowledge.
First enter ls-l in the terminal
The results are as follows:
The result of the terminal output is a line of characters, each line of characters corresponding to a directory or file
If it is a file, the first character of the string information of the line is "-"
If it is a directory, the first character of the line is "d", which means directory. If you find the difference between the two, the run can tell the difference.
1. Display the files in the directory: ls-l | grep "^ -"
Where "^ -" indicates that the first character of the string is "-"
Running result:
We can use the wc command to do statistics:
Wc [- lwm]
Parameters:
-l list only the number of rows
-w only how many words are listed (English words)
-m how many characters
So, 2. Count the number of files in the folder ls-l. / | grep "^ -" | wc-l
3. Count the number of directories in the folder ls-l. / | grep "^ d" | wc-l
4. Count the number of files in the folder, including sub-files ls-lR | grep "^ -" | wc-l
5. Count the number of directories under the folder, including subdirectories ls-lR | grep "^ d" | wc-l
What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.
Thank you for reading this. The editor hopes that you will have the most profound experience from the practical level on the key issue of "what is the command for Linux system to view the number of files under the folder". The specific use also requires everyone to practice and use it before you can understand it. If you want to read more related articles, 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: 257
*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.