计算文件,隐藏文件除外 [英] Count files, except the hidden files

查看:52
本文介绍了计算文件,隐藏文件除外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试计算当前文件夹及其子文件夹中的所有文件.

I'm trying to count all the files from the current folder and each of it's sub-folders.

find . -type f \(! -iname ".*" \) -print

推荐答案

您可以使用以下 find 命令:

find -type f ! -regex ".*/\.[^/]+$"  | wc -l

它将找到当前目录中所有文件名不是以.开头的文件,也就是隐藏文件.

It will find all files in the current directory with filename not starting with a ., aka hidden files.

这篇关于计算文件,隐藏文件除外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆