---
title: "Linux 查看目录大小及文件数量命令"
author: "libin123"
date: "2012-04-10T10:29:14Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2012-04-10T10:29:00Z"
id: 1481482
url: "https://dbua.iteye.com/blog/1481482"
---

查看当前目录大小：

\[root@21andy.com]# du -sh

查看指定目录大小：

\[root@21andy.com]# du -sh /www/21andy.com

查看当前目录文件总数：

\[root@21andy.com]# find . -type f |wc -l

查看指定目录文件总数：

\[root@21andy.com]# find /www/21andy.com -type f |wc -l

查看当前目录的目录总数：

\[root@21andy.com]# find . -type d |wc -l

查看指定目录的目录总数：

\[root@21andy.com]# find /www/21andy.com -type d |wc -l