---
title: "shell查看目录文件大小"
author: "genggeng"
date: "2012-01-03T21:53:08Z"
tags: ["shell"]
categories: ["编程语言"]
slug: "shell"
draft: false
lastmod: "2012-01-03T21:53:08Z"
id: 1333840
url: "https://genggeng.iteye.com/blog/1333840"
---

在ubuntu系统中，我们经常需要查看所剩磁盘空间大小

```
df -h
```

 如果我们需要查看某一目录下，各个文件的大小，则

```
du -sh *
```

 但上述无法查看隐藏文件，隐藏文件以.开头，这时若要查看，则使用

du -sh \[^.]*

```
du -sh [^.]*
```