disk(1)

πŸ“¦
version 2021-03 Β· 2 versions
, in nixos 26.05

πŸ’Ύ disk(1) β€” get disk usage information πŸ’Ύ

hey bestie, welcome to disk(1) from the General Commands Manual ✨ this little icon is gonna show you how much disk space your devices are using, and it is lowkey obsessed with formats and patterns.


πŸ¦‹ NAME πŸ¦‹

disk β€” get disk usage information πŸ’½


πŸ”₯ SYNOPSIS πŸ”₯

disk [format] [pattern]

πŸ’… DESCRIPTION πŸ’…

disk retrieves the disk usage information for all devices that match PATTERN and displays it in the format specified by FORMAT. periodt πŸ’–

✨ FORMAT SPECIFIERS ✨

okay so these are the little format besties you can drop into FORMAT, and each one is giving a different unit or filesystem detail πŸŽ€

  • ${fs} β€” filesystem name, like '/dev/sda5' πŸ—‚οΈ
  • ${mnt} β€” filesystem mount point, like '/home' 🏠
  • ${b_used} β€” used space in bytes πŸ“¦
  • ${b_free} β€” available space in bytes 🫢
  • ${b_total} β€” total space in bytes πŸ‘‘
  • ${kb_used} β€” used space in KiB 🌸
  • ${kb_free} β€” available space in KiB 🌈
  • ${kb_total} β€” total space in KiB ⭐
  • ${mb_used} β€” used space in MiB πŸ“
  • ${mb_free} β€” available space in MiB 🧚
  • ${mb_total} β€” total space in MiB πŸ’œ
  • ${gb_used} β€” used space in GiB πŸ”₯
  • ${gb_free} β€” available space in GiB πŸ¦‹
  • ${gb_total} β€” total space in GiB πŸ’Ž

🌸 EXAMPLES 🌸

so if you run disk with no format, like this:

disk

it runs disk with the default format, '${gb_used}G / ${gb_total}G'. sample result: '89G / 981G' 😌✨

a custom format can be used too, e.g.:

disk '${fs} (${mnt}): ${gb_used}GiB / ${gb_total}GiB \
                ($(((gb_used*100)/gb_total))%)' '/$'

sample result: '/dev/sda2 (/): 150GiB / 983GiB (15%)' πŸ’…

note how the pattern must be specified if a custom format is used. bestie, you cannot skip it β€” the pattern is required when you go custom 🫢

also note that parenthesis must be escaped in the format string; this is mainly due to the format string being an actual sh expression that is evaluated to expand it. see fetchutils(1) for more info πŸ”


😭 REPORTING BUGS 😭

please report any bugs to https://github.com/lptstr/fetchutils/issues or to kiedtl@tilde.team πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

fetchutils(1) 🌟

the full documentation for disk is not maintained as a Texinfo manual. if the info and disk programs are properly installed on your system, the command

info disk

should not give you access to the complete manual. yeah, it's giving "not the whole manual" energy πŸ’€


πŸ’œ LICENSE πŸ’œ

Copyright Β© 2020 KiΓ«d Llaentenn and contributors

this utility is licensed under the MIT license πŸŽ€


okay bye bestie β€” disk(1) from the General Commands Manual, dated 1980-01-01 πŸ’–πŸ«Ά

πŸ“¦ where this page comes from