[Top][All Lists]

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

Re: -size option

From: Andreas Metzler
Subject: Re: -size option
Date: Tue, 17 Nov 2015 19:07:37 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

On 2015-11-14 David Staron <address@hidden> wrote:
> Hello, I noticed some strange behaviour of the ‘-size’ option of
> ‘find’, it doesn’t seem to behave like documented here
> <https://www.gnu.org/software/findutils/manual/html_mono/find.html#Size>
> , and i read this is the mailing list to report it. Please see
> below, i doubt it’s a bug… but does this make any sense to anyone?


| -size n[cwbkMG]
| File uses n units of space.  The following suffixes can be used:
| [...]
| `M'    for Megabytes (units of 1048576 bytes)

"-size 1M" is *not* a shorthand for "-size 1048576". The formers checks
how many units of 1048576 bytes each a files uses, where partly used
counts as used.

> root /etc/apache2/sites-available # ls -lah
> total 24K
> drwxr-xr-x 2 root root 4.0K Nov 14 21:21 .
> drwxr-xr-x 8 root root 4.0K Nov 14 20:37 ..
> -rw-r--r-- 1 root root 2.0K Nov 14 19:33 000-default.conf
> -rw-r--r-- 1 root root 6.3K Feb  1  2015 default-ssl.conf

All files are nonzero but smaller than 1 MB, each of these uses 1
"unit of 1048576 bytes" and will match 1M or +0M.

cu Andreas
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

reply via email to

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