on the Internet to see a test shell problem--the statistics of a folder size greater than 7MB the folder
Okay, I'll do it. Deep, personal feel, this problem is the main test of the regular use of the Linux proficiency (I am not very familiar with, haha), the topic to statistics, mainly used to two steps: Find + count, as long as the folder is more than 7MB to find out folders, and then can count. Find out what command to use, you can use Find, find out a folder with a size larger than 7MB folder with
Find. -size +7m-type D #在当前目录下查找
Then, the count of what to use, you can use WC, here only to calculate the number of rows, because find to match the criteria of the folder filter out, to count the number of files, in fact, is the statistics of the number of rows,
Find. -size +7m-type D | Wc-l
in this way, the topic is basically solved. Of course, you can write that.
Find. -size +7m-type D | awk ' End{print NR} '
The answer is not the only one, by the way, there are interesting articles about find ,
Mommy, I found it!-15 practical Linux Find Command Examples (Chinese translation)with regard to the number of Linux statistics rows,
Linux statistics line count method and efficiency test
The face question of the shell