coreutils
[Top][All Lists]
Advanced

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

df: --inodes versus --portability mode


From: Bernhard Voelker
Subject: df: --inodes versus --portability mode
Date: Tue, 18 Sep 2012 11:47:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

According to the info pages, the -P mode is like the default mode:

`-P'
`--portability'
     Use the POSIX output format.  This is like the default format
     except for the following:

       1. The information about each file system is always printed on
          exactly one line; a mount device is never put on a line by
          itself.  This means that if the mount device name is more
          than 20 characters long (e.g., for some network mounts), the
          columns are misaligned.

       2. The labels in the header output line are changed to conform
          to POSIX.

       3. The default block size and output format are unaffected by the
          `DF_BLOCK_SIZE', `BLOCK_SIZE' and `BLOCKSIZE' environment
          variables.  However, the default block size is still affected
          by `POSIXLY_CORRECT': it is 512 if `POSIXLY_CORRECT' is set,
          1024 otherwise.  *Note Block size::.

BTW: I don't see in the code why df would split an entry on several lines.

To my question:
Reading the above, I would assume that -P would override a previous
-i (or be mutually exclusive to that), but it doesn't:

  $ df -iP | head -n 2
  Filesystem       Inodes   IUsed    IFree IUse% Mounted on
  rootfs           768544  237523   531021   31% /

For the implementation of the new --output option, and the cleanup
necessarily coming with it, I'd like to fix that so that a -P will
override a previous -i and vice versa:

  $ src/df -iP | head -n 2
  src/df: warning: option '-P' is overriding the previous mode
  Filesystem     1024-blocks      Used Available Capacity Mounted on
  rootfs            12095032   7515424   3965208      66% /

  $ src/df -Pi | head -n 2
  src/df: warning: option '-i' is overriding the previous mode
  Filesystem       Inodes   IUsed    IFree IUse% Mounted on
  rootfs           768544  237523   531021   31% /

WDYT?

Have a nice day,
Berny




reply via email to

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