bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44273: "total used in directory 19 available 5.2 GiB"


From: Jean Louis
Subject: bug#44273: "total used in directory 19 available 5.2 GiB"
Date: Sun, 1 Nov 2020 22:16:02 +0300
User-agent: Mutt/+ (1036f0e) (2020-10-18)

* Mattias Engdegård <mattiase@acm.org> [2020-11-01 18:42]:
> 1 nov. 2020 kl. 16.21 skrev Eli Zaretskii <eliz@gnu.org>:
> 
> > This actually means that this value provides information that is not
> > directly available in the file sizes.  So it is useful.
> 
> No and no: the information is available in the file sizes, but the
> 'file size' of a subdirectory is practically impossible to interpret
> in a useful way.

You may read the manual page for `ls' as `ls' output is displayed by
dired. What may not be usable to you at first sight, may be usable for
others. I have not been watching this detail you pointed out, but it
was always usable to see the free space on various partitions or
remote directories.

The manual page for GNU ls says:

        -k, --kibibytes
                default to 1024-byte blocks for disk usage

so if you write:

ls -la

or

ls -lka

You get same output as size of directory is shown in kibibytes.

Example:

 ls -l
total 4
lrwxrwxrwx 1 admin admin   37 Sep 22 23:41 Mobil -> 
/home/data1/protected/Downloads/Mobil
drwx------ 3 admin admin 4096 Aug 12 08:26 Old IceCat Data
lrwxrwxrwx 1 admin admin   21 Sep 30 02:06 protected -> /home/data1/protected

But if I see something like this:

ls -la |head 
total 1379484

then I know by watching the number it is about 1379 megabytes. I am
wrong because conversion tells me it is 1412 megabytes and 1347
mebibytes. But I have got a feeling of how much space files in the
directory occupy.

To make it more human friendly there is option -h that you may set in
variable `dired-listing-switches' and just add `h' somewhere with
`-al' together then you get something like:

ls -lha |head 
total 1.4G

You can set it by tweaking option `dired-listing-switches':

        --block-size=SIZE
                scale  sizes  by  SIZE   before  printing  them;  e.g.,
                '--block-size=M'  prints sizes  in  units of  1,048,576
                bytes; see SIZE format below

        The SIZE argument is an  integer and optional unit (example:
        10K is 10*1024).  Units are K,M,G,T,P,E,Z,Y (powers of 1024)
        or KB,MB,... (powers of 1000).

Dired will show you whatever you set for `ls'

Be happy to be on GNU based system, as ls will give you good usage
help with:

$ ls --help

while on BSD-like free software system like Dragonfly BSD you get
this (as there is no help option)

ls --help
ls: illegal option -- -
usage: ls [-1ABCFGHILPRSTW_abcdfghiklmnopqrstuwxy] [-D format] [file ...]


So it is not a bug, it is feature and some people may like to read it
in blocks of 1024 bytes and some may like in kilobytes or similar.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]