MEM(1)

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

✨ NAME ✨

okay so bestie, this is the mem(1) page from the General Commands Manual β€” and it is literally all about getting memory usage πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

mem [format]

πŸ’– DESCRIPTION πŸ’–

mem is out here retrieving the amount of memory used, the amount of free memory, and the total amount of memory in bytes, KiB, MiB, and GiB. no cap, that’s the whole gig ✨

πŸŽ€ FORMAT SPECIFIERS πŸŽ€

these are the little format placeholders, bestie β€” every single one is iconic in its own way:

  • ${b_used} β€” bytes of used memory
  • ${b_free} β€” bytes of free memory
  • ${b_total} β€” bytes of total memory
  • ${kb_used} β€” KiB of used memory
  • ${kb_free} β€” KiB of free memory
  • ${kb_total} β€” KiB of total memory
  • ${mb_used} β€” MiB of used memory
  • ${mb_free} β€” MiB of free memory
  • ${mb_total} β€” MiB of total memory
  • ${gb_used} β€” GiB of used memory
  • ${gb_free} β€” GiB of free memory
  • ${gb_total} β€” GiB of total memory

🌸 EXAMPLES 🌸

executing mem with no arguments, like so:

mem

runs mem with the default format, '${mb_used}M / ${mb_total}M'.

sample result: 2726M / 4053M

a custom format may be used, e.g.:

mem '${gb_used}G used out of ${gb_total}'

this will run mem with the format '<USED>G used out of <TOTAL>G'.

sample result: 3G used out of 4G

a more complex (and extremely messy) example:

mem '${b_used} ${b_total}' |
        awk '{
                p=($1*10)/$2
                printf "[%0*s%*s]n", p, "", 10 - p, ""
        }' |
        sed 's/0/#/g'

here, the raw output of mem in bytes is piped to awk and used to create a bar showing the memory consumption.

sample result: [####### ]

πŸ’… REPORTING BUGS πŸ’…

please report any bugs to https://github.com/lptstr/fetchutils/issues or to kiedtl@tilde.team. do it for the plot, bestie 🫢

🫢 SEE ALSO 🫢

fetchutils(1)

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

info mem

should not give you access to the complete manual. iykyk 😭

πŸ‘‘ LICENSE πŸ‘‘

Copyright Β© 2020 KiΓ«d Llaentenn

this utility is licensed under the MIT license. periodt πŸ’…


okay that’s the whole vibe β€” the footer on this page is MEM(1) with the date 1980-01-01, so bye bestie πŸ’–βœ¨

πŸ“¦ where this page comes from