使用head,sort,tr查找var目录中最大的前10个文件(包括子目录和隐藏文件)

・1 分钟阅读

找到/var目录中的最大10个最大文件(包含子目录和隐藏文件)

tree -ihafF /var | tr '[]' ' '| sort -k1hr|head -10
示例输出
 174M /var/lib/snapd/snaps/spotify_34.snap
 169M /var/cache/pkgfile/community.files
 151M /var/lib/snapd/snaps/gnome-3-28-1804_31.snap
 151M /var/lib/snapd/snaps/gnome-3-28-1804_36.snap
 144M /var/lib/snapd/snaps/gnome-3-28-1804_23.snap
 132M /var/lib/snapd/snap/spotify/34/usr/share/spotify/libcef.so
 116M /var/cache/pacman/pkg/libreoffice-fresh-6.2.2-4-x86_64.pkg.tar.xz
 112M /var/log/journal/f0be989aba024547ad095245b1c9e100/system@4ba3e3da5ee94965bb22f9942a24670d-0000000000000001-000
讨论
Hujiuxiang profile image