WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: df options  (Read 1841 times)

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
df options
« on: June 13, 2018, 06:40:32 PM »
Busybox df apparently has a number of options:
Code: [Select]
        -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

The problem is that P, k, m, and B don't appear to do anything other than 'h':
Code: [Select]
tc@box:~$ df -P /dev/sda1
Filesystem                Size      Used Available Capacity Mounted on
/dev/sda1                31.1G     27.1G      4.0G  87% /mnt/sda1
tc@box:~$ df -k /dev/sda1
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1                31.1G     27.1G      4.0G  87% /mnt/sda1
tc@box:~$ df -m /dev/sda1
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1                31.1G     27.1G      4.0G  87% /mnt/sda1
tc@box:~$ df -B 1024 /dev/sda1
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1                31.1G     27.1G      4.0G  87% /mnt/sda1

If I really want to know I have to use fdisk?
Code: [Select]
tc@box:~$ fdisk -l /dev/sda
Disk /dev/sda: 32 GB, 34091302912 bytes, 66584576 sectors
4144 cylinders, 255 heads, 63 sectors/track
Units: cylinders of 16065 * 512 = 8225280 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1 *  0,1,1       1023,254,63         63   66573359   66573297 31.7G 83 Linux

Is this expected behavior, or a feature? I see this on both 32-bit and 64-bit.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: df options
« Reply #1 on: June 13, 2018, 08:34:12 PM »
Is there an alias?

df='df -h'

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: df options
« Reply #2 on: June 13, 2018, 10:14:11 PM »
Now that you mention it, yes. In /etc/skel/.ashrc, and as a consequence, ~/.ashrc. I guess there must have been a reason.  ::)