为什么不“总计"?从ls -l累加到列出的文件总大小? [英] Why doesn't "total" from ls -l add up to total file sizes listed?

查看:57
本文介绍了为什么不“总计"?从ls -l累加到列出的文件总大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在 ls -l <​​/code>输出中的 total 显示为 64 而不是 26078 列出的所有文件总数?

Why is the total in the output of ls -l printed as 64 and not 26078 which is the total of all files listed?

    $ ls -l ~/test/ls
    total 64
    -rw-r--r--   1 root root   15276 Oct  5  2004 a2ps.cfg
    -rw-r--r--   1 root root    2562 Oct  5  2004 a2ps-site.cfg
    drwxr-xr-x   4 root root    4096 Feb  2  2007 acpi
    -rw-r--r--   1 root root      48 Feb  8  2008 adjtime
    drwxr-xr-x   4 root root    4096 Feb  2  2007 alchemist

推荐答案

您可以在平台的 ls 文档中找到该行的定义.对于 coreutils ls (在许多Linux系统上都可以找到),可以通过 info coreutils ls 查找信息:

You can find the definition of that line in the ls documentation for your platform. For coreutils ls (the one found on a lot of Linux systems), the information can be found via info coreutils ls:

对于列出的每个目录,请在文件前添加一行`total BLOCKS',其中BLOCKS是所有磁盘的总分配该目录中的文件.

For each directory that is listed, preface the files with a line `total BLOCKS', where BLOCKS is the total disk allocation for all files in that directory.

这篇关于为什么不“总计"?从ls -l累加到列出的文件总大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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