1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-08 17:48:01 +00:00

Add Show The Size Of Everything In A Directory As A Unix TIL

This commit is contained in:
jbranchaud
2017-12-28 10:18:24 -06:00
parent 277156dce0
commit 499527fa90
2 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
# 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.