Article From:https://www.cnblogs.com/yuanchaoyong/p/9906482.html

1、Statistics the number of files in the current folder, including those in the subfolder

ls -lR|grep "^-"|wc -l

The following picture:

2、Statistics the number of directories in a folder, including those in a subfolder

ls -lR|grep "^d"|wc -l

The following picture:

3、Statistics the number of files in the current folder

ls -l |grep "^-"|wc -l

The following picture:

4、Statistics the number of directories in the current folder

ls -l |grep "^d"|wc -l

The following picture:

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *