# Show The Size Of Everything In A Directory

The `ls` command will list everything in a given directory. The `du` command is used to display disk usage statistics -- with the `-sh` flag, it will display the file size in a human readable format.

We can combine these two commands with `xargs` to get a listing of the sizes of everything in a directory.

```
ls | xargs du -sh
```

See `man du` and `man xargs` for more details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/os/unix/directory/show-the-size-of-everything-in-a-directory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
