display the contents of /var/log sorted by size in human readable format
时间: 2024-05-10 11:16:49 浏览: 75
You can use the following command to display the contents of /var/log sorted by size in human-readable format:
```
sudo du -ah /var/log | sort -rh | head -n 20
```
This will display the top 20 largest files and directories in /var/log, sorted by size in a human-readable format (e.g. "1.2M" instead of "1324736"). The "-h" flag on the "sort" command tells it to sort by human-readable numbers, and the "-n" flag on the "head" command tells it to display the first 20 lines of output.
阅读全文