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

问题描述

为什么 ls -l 的输出中的 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 是所有磁盘的总分配该目录中的文件.

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

07-22 17:30
查看更多