ls -l|wc -l

统计当前目录下的非隐藏目录和非隐藏文件的个数要在统计结果后减去一.

ls -la |wc -l
统计当前目录下的所有文件和目录的个数实际数目也是总数减去一

find ./ -type f -maxdepth 1 |wc -l
统计当前目录下的所有文件包括隐藏文件只统计文件.

-maxdepth 1 只统计当前目录如果你想统计当前目录下的子目录中的文件 把1 改成你想要的层次就可以了.

  6 Responses to “统计一个目录下有多少文件”

  1. 你好

    想请你帮忙指点我一下在mac os下面如何安装WUSB54G V.4无线网卡。我是X61装上10.5.6之后想使用这块usb无线网卡,可惜一直找不到。恳求你的帮忙,十分感谢。
    我的邮箱wangwub@gmail.com

  2. 下载这个驱动试试,http://www.liumin.name/20080301/install-linksys-wusb54gc-on-leopard/

  3. 请问你认识胡小实么?

  4. 不错,非常支持。

  5. 路过拜访!!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 刘敏的Blog Suffusion theme by Sayontan Sinha