Example Analysis of nesting creation folder under centos
This article is to share with you the content of an example analysis of nested folders created under centos. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
How many folders can be created nested under centos?
This is an assignment that the teacher left us to think about, so we kept mkdir,mkdir, and finally found that it could not be done by hand. So a script file is written to execute automatically, and the code is as follows:
1 #! / bin/bash / / defines that bshell executes 2 iComple1 / / initializes a variable to record how many files are created, which, by the way, is used as the file name, and finally I represents the number of nesting 3 while true / / continue to create 4 do 5 mkdir $I / / create directory 6 cd $I / / into the created directory to facilitate the creation directory 7 I = `expr $I + 1`; / / I add 1 operation 8 echo $I > ~ / test/num / / output the result to the folder under the running directory 9 done
I used CentOS6.5 to do the experiment, and the final result was 1107.
Use the du command to query the size of folder 1, 4428, or 4 bytes per directory. It's the same size as just creating an empty folder.
Thank you for reading! This is the end of this article on "sample Analysis of nesting folders under centos". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!