QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1302|回复: 5

请问用什么指令可以统计出目录中文件的数目?

[复制链接]
发表于 2003-11-23 22:50:11 | 显示全部楼层 |阅读模式
ls 查不到相关的参数
发表于 2003-11-24 08:40:33 | 显示全部楼层
ls | wc -l
回复

使用道具 举报

发表于 2003-11-24 16:22:49 | 显示全部楼层
根本不行,老大,你不是骗人的吧
回复

使用道具 举报

发表于 2003-11-25 10:15:59 | 显示全部楼层
可以的亚。我试过楼上的方法。
要不 ,用两步走。
ls foldername > countdir
wc –w < countdir
不过 ls | wc -l 真的好用。
回复

使用道具 举报

发表于 2003-11-25 16:49:15 | 显示全部楼层
[quote:00cde43547="hainanxq"]根本不行,老大,你不是骗人的吧[/quote]

[root@redhat71 /tmp/123]# touch 1.mp3 2.mp3 3.mp3
[root@redhat71 /tmp/123]# ls
1.mp3  2.mp3  3.mp3
[root@redhat71 /tmp/123]# ls | wc -l
      3
[root@redhat71 /tmp/123]# wc --help
用法:wc [选项]... [文件]...
Print byte, word, and newline counts for each FILE, and a total line if
more than one FILE is specified.  With no FILE, or when FILE is -,
read standard input.
  -c, --bytes            print the byte counts
  -m, --chars            print the character counts
  -l, --lines            print the newline counts
  -L, --max-line-length  print the length of the longest line
  -w, --words            print the word counts
      --help     显示此帮助信息并离开
      --version  显示版本信息并离开

Report bugs to <[email protected]>.
[root@redhat71 /tmp/123]#
回复

使用道具 举报

发表于 2003-11-26 09:22:44 | 显示全部楼层
行了,谢谢redhat71老大,其实是我自己看错了,不好意思。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-20 13:43 , Processed in 0.046528 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表