3 ms·
`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`.
by 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.