Find command View (recommended):
Number of subdirectories:
[[email protected] ~]# findAfish-type D | Wc-l
158
[[email protected] ~]# findafish/-type D | Wc-l
158
[[email protected] ~]# findafish/*-type D | Wc-l
157--Correct
Results for different reasons:
[[email protected] ~]# findAfish-type D | More
Afish-first line of output results
[[email protected] ~]# findafish/*-type D | More
Afish/examples-first line of output results
Summary: Use afish/* does not contain the parent directory of Afish, only the subdirectories below it.
Number of all files:
[[email protected] ~]# findAfish-type F | Wc-l
981
[[email protected] ~]# findafish/-type F | Wc-l
981
[[email protected] ~]# findafish/*-type F | Wc-l
981
Tree command view (not recommended):
[Email protected] ~]# treeAfish
......
157 directories, 978 files
-----------------------------------------
[Email protected] ~]# treeafish/
......
157 directories, 978 files
Du command view:
[Email protected] ~]# Du-ahafish/*| Wc-l
1138
Summary: du views The result is 1138, the number of subdirectories is 157, the number of files is: 1138-157=981, so the tree command to view the results should be inaccurate, as far as the calculation of which file, no longer check the problem, we recommend the Find command to view.
Linux View the number of subfolders and files