Linux: Check the Number of Folders and Files
作者:XD / 发表: 2023年2月14日 03:38 / 更新: 2023年2月14日 03:38 / 编程笔记 / 阅读量:1073
Linux: Check the Number of Folders and Files
# check the file number in the current directory
ls -l |grep -c "^-"
# check the folder number in the current directory
ls -l |grep -c "^d"
# check the file number in the current directory and subdirectory
ls -lR | grep -c "^-"
# check the folder number in the current directory and subdirectory
ls -lR | grep -c "^d"
# check the file with "md" number in the current directory and subdirectory
ls -lR | grep "^-" | grep -c "md$"
# check the "py" file number in the current directory
ls -l | grep -c "py"
相关标签