Unix 查找平均文件大小 [英] Unix find average file size

查看:60
本文介绍了Unix 查找平均文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含大量文件的目录,我想找到这些文件的平均文件大小,所以像 ls somethinghere 什么是所有东西的平均文件大小?

I have a directory with a ton of files I want to find the average file size of these files so something like ls somethinghere whats the average file size of everything meets that?

推荐答案

我在这里找到了一些东西:
http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html

I found something here:
http://vivekjain10.blogspot.com/2008/02/average-file-size-within-directory.html

要计算 Linux 系统上目录内的平均文件大小,可以使用以下命令:

To calculate the average file size within a directory on a Linux system, following command can be used:

ls -l | gawk '{sum += $5; n++;} END {print sum/n;}'

这篇关于Unix 查找平均文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆