Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| user:yeti:opkg-list-user-installed-packages [2018/01/16 08:41] – [2018-01-16] shorter 'du' vs 'du -s' example yeti | user:yeti:opkg-list-user-installed-packages [2018/02/03 01:06] – [2018-01-16] yeti | ||
|---|---|---|---|
| Line 63: | Line 63: | ||
| :?: Why '' | :?: Why '' | ||
| - | :!: Have a look: | + | :!: Have a look: //(the example was run on Debian)// |
| < | < | ||
| - | $ du logs | awk '{ print ; s+=$0 } END { print s" | + | $ du logs |
| 8 | 8 | ||
| 8 | 8 | ||
| Line 71: | Line 71: | ||
| 24 logs/refs | 24 logs/refs | ||
| 32 logs | 32 logs | ||
| - | 84 ---TOTAL--- | ||
| </ | </ | ||
| - | The directories have are entered and all their files are shown in '' | + | The script only needs the summary |
| < | < | ||
| - | $ du -s logs | awk '{ print ; s+=$0 } END { print s" | + | $ du -s logs |
| 32 logs | 32 logs | ||
| - | 32 ---TOTAL--- | ||
| </ | </ | ||
| + | If called with files and directories, | ||
| + | < | ||
| + | $ ls -ld description logs | ||
| + | -rw-r--r-- 1 yeti yeti 73 Mai 15 2017 description | ||
| + | drwxr-xr-x 3 yeti yeti 4096 Mai 15 2017 logs | ||
| + | $ du -s description logs | ||
| + | 4 | ||
| + | 32 logs | ||
| + | </ | ||
| + | As long as this script shall show no intermediate results, letting '' | ||