The method of calculating the number of files [Posts] below the Linux

Linux Command - the number of files in the directory View

 Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/sand_clock/article/details/80908733

View the number of files under the current directory

ls -l | Grip "^ - '| wc -l

View the current number of files in the directory (file contains subdirectories)

ls -lH | Grip "^ - '| wc -l

View the number of current directory directory

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

View the current number of directory directory (the directory that contains subdirectories)

ls -lH | Grip "^ d" | wc -l

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11106388.html