sindresorhus / df

Get free disk space info from `df -kP`
MIT License
64 stars 12 forks source link

Columns incorrectly detected #16

Open spvn87 opened 2 years ago

spvn87 commented 2 years ago

Running on node16 + alpine3.14:

df output:

/root # df -kP /data0
Filesystem           1024-blocks    Used Available Capacity Mounted on
//10.0.1.100/data0   59979045276 50147765800 9831279476  84% /data0

Module output:

> require('@sindresorhus/df').file('/data0').then(console.log)
> {
  filesystem: '//10.0.1.100/data0',
  size: 61418542362624,
  used: 5135130624,
  available: 5939200,
  capacity: 794.76,
  mountpoint: '% /data0'
}

df info:

/root # df --version
df: unrecognized option: version
BusyBox v1.33.1 () multi-call binary.

Usage: df [-PkmhTai] [-B SIZE] [FILESYSTEM]...

Print filesystem usage statistics

        -P      POSIX output format
        -k      1024-byte blocks (default)
        -m      1M-byte blocks
        -h      Human readable (e.g. 1K 243M 2G)
        -T      Print filesystem type
        -a      Show all filesystems
        -i      Inodes
        -B SIZE Blocksize

Let me know if there's anything else I can provide

sindresorhus commented 2 years ago

Probably same issue as https://github.com/sindresorhus/df/issues/13#issuecomment-943173528.