get_machine(1)
β¨ get_machine(1) β the get_machine page from the User Manuals β¨
okay bestie, pull up a chair πͺ because this little icon does ONE job and it does it slayfully: it tells you what hardware you're on. no cap.
π NAME π
get_machine β figure out which hardware architecture is actually running over here π
π SYNOPSIS π
get_machine [ --exact --override OVERRIDE --os ]
π¦ DESCRIPTION π¦
so like, get_machine exists for one reason and one reason only: to make it easy to write lil baby shell scripts that need to know which hardware architecture they're assuming, or which host operating system is being used. it's giving "helpful bestie who always knows what laptop you're on" π
at its core, the whole vibe is: figure out the general hardware architecture and return it as fast as humanly possible β‘. although, ngl, sometimes it's genuinely useful to return something different β which is exactly why --override exists, and whatever you hand it just gets returned right back at you. no questions asked.
scripts that wanna expose that override power to their users can leverage the environment variable GET_MACHINE_FLAGS β that way people can override things efficiently without you writing a whole parser. lowkey genius. β¨
or, if you only wanna override which operating system is running, then the environment variable you want is GET_MACHINE_OS_FLAGS instead.
if you want something more exact than just x86 or amd64, the --exact option will hand you more specific values, like i686-pae β yes she's detailed like that π.
and if you're dying to know the host operating system? that's what --os is for π«Ά
β οΈ a word of warning, bestie: --override always takes top precedence. always always. and it can return anything you desire. literally anything. it is ungovernable and we respect that π
πΈ EXAMPLES πΈ
typically, get_machine lives inside scripts used in bootstrapping. here's the group chat receipts:
# get_machine
# get_machine --override "I am the very model of a modern major general"
# get_machine ${GET_MACHINE_FLAGS}
# get_machine ${GET_MACHINE_OS_FLAGS} --os
π COMPATIBILITY π
get_machine is compatible with all Turing complete machines π β even the ones that try to be Turing complete -1. (we don't talk about those ones, but we love them anyway π)
π AUTHORS π
Jeremiah Orians <Jeremiah@pdp10.guru> β the icon, the legend, the moment β
π COPYRIGHT π
Copyright 2016-2021 Jeremiah Orians <Jeremiah@pdp10.guru> License GPLv3+.
π§ SEE ALSO π§
M1(1), hex2(1), blood-elf(1), kaem(1), syscalls(2) β the whole friend group, go say hi π«Ά
and that's the whole page bestie!! this one shipped on Linux, dated JULY 2019, and it's the get_machine(1) page from the User Manuals. periodt π
β¨π
π¦ where this page comes from
- debian bookworm: mescc-tools 1.4.0-1 Β· GPL-3.0-or-later
- debian trixie: mescc-tools 1.5.2-1 Β· GPL-3.0-or-later
- ubuntu jammy: mescc-tools 1.3-2 Β· GPL-3.0-or-later
- ubuntu noble: mescc-tools 1.4.0-1 Β· GPL-3.0-or-later
- ubuntu questing: mescc-tools 1.5.2-1ubuntu1
- ubuntu resolute: mescc-tools 1.5.2-1ubuntu2 Β· GPL-3.0-or-later
- ubuntu stonking: mescc-tools 1.5.2-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms