3 ms·
Ironically - neither `uname -r` or `cat /proc/version` return an architecture on my laptop, but `arch` works just fine. $ uname -r 5.8.0-50-generic $
by ghshephard 5y ago
Ironically - neither `uname -r` or `cat /proc/version` return an architecture on my laptop, but `arch` works just fine.
$ uname -r
5.8.0-50-generic
$ arch
x86_64
uname -m works though:
$ uname -m
x86_64
- kps 5y ago`uname -m` is POSIX; `/proc/version` is not. And `uname -s` will tell you whether you're on a system that is likely to have `/proc/version`.
- chestervonwinch 5y agoJust to be clear, you're saying "uname -s == Linux" => "/proc exists" right? Not trying to be pedantic; just having a TIL moment.
- kps 5y ago‘Mostly true’, as they say. If `uname -s` is not 'Linux', then it's quite unlikely there will be a Linux-style /proc with assorted non-process things in it. If it is Linux, it's probably there; technically as it's a mounted file system it might not be present, but I've never even seen an embedded Linux without it.