Ubuntu查看当前目录文件个数

Ubuntu查看当前目录文件个数

查看当前目录下的文件数量
ls -l|grep “^-”| wc -l

查看当前目录下的文件数量(包含子目录)
ls -lR|grep “^-”| wc -l

查看当前目录下的文件夹个数
ls -l|grep “^d”| wc -l


root@doit-System-Product-Name:~/model$ ls -l|grep "^-"| wc -l
4
root@doit-System-Product-Name:~/model$ ls -lR|grep "^-"| wc -l
22
root@doit-System-Product-Name:~/model$ ls -l|grep "^d"| wc -l
4
root@doit-System-Product-Name:~/model$ 
发布了143 篇原创文章 · 获赞 345 · 访问量 47万+

猜你喜欢

转载自blog.csdn.net/qq_31456593/article/details/89531826