Questions tagged [uname]

A command on Unix and Unix-like operating systems that prints out information about the machine and OS.

uname is a command on Unix and Unix-like operating systems that prints out information about the machine and OS.

This tag is used when asking for ways to get information about the machine.

Frequently asked questions

References

53 questions
1
vote
1 answer

uname Syscall Missing Operating System String Present in uname -a Output

When I run uname -a on the command line, I get the following output: Linux raspberrypi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux This is achieved by the -a parameter which is equivalent to using these parameters (there…
TheKraken
  • 21
  • 3
1
vote
1 answer

Why doesn't this micropython function work?

I have written a function in micropython that attempts to retrieve uname information and strip out stuff I don't want and then return a value: import os def get_uname(): my_uname = os.uname()[3] my_uname = my_uname.replace("(GNU…
Robert Baker
  • 167
  • 1
  • 1
  • 14
1
vote
1 answer

What's the difference between two kernel version shown by ‘uname -a’?

I am using debian 9.4, the kernel version shown by uname -a is different, what's the actual kernel version? What does '4.9.82-1+deb9u3' mean? Linux debian 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux apt-get source…
river
  • 694
  • 6
  • 22
1
vote
0 answers

Conditional docker settings for remote debugging depending on OS

How can the php.ini setting be set conditionally depending on local operating system? The .env file contains two variables: XDEBUG_ENABLE=true PHP_INI=./docker/runner/php.ini-development Docker-compose.yml looks like this: ... build: context: . …
naptoon
  • 1,203
  • 2
  • 8
  • 11
1
vote
2 answers

Is there a pythonic way to check whether OS is a 64bit Ubuntu?

Is there a pythonic way to check whether OS is a 64bit Ubuntu? Currently, I've been doing it as such: import os def check_is_linux(distro, architecture, err_msg): try: this_os = os.popen('lsb_release -d').read() this_arch =…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
2 answers

Why am I getting an error when I use `uname` in my .bashrc?

In my .bashrc I have the following code if [`uname` == "Linux"]; then echo "It worked" else echo "It didn't work" fi But when I source my .bashrc I get the following results [Linux: command not found It didn't work Strangly, the [ is not…
Fred
  • 1,054
  • 1
  • 12
  • 32
0
votes
0 answers

while loop to ssh only take first element

I look for getting uname -a on a list of VMs: $ ssh srv-13 uname -a Linux srv-13 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2 (2019-08-28) x86_64 GNU/Linux $ $ ssh akd4 uname -a Linux akd4 4.19.0-22-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64…
user3313834
  • 7,327
  • 12
  • 56
  • 99
0
votes
0 answers

What's the meanning of the options of linux command `uname`?

From man uname: -a, --all print all information [...] -m, --machine print the machine hardware name -p, --processor print the processor type or "unknown" -i, --hardware-platform print the hardware…
wymli
  • 1,013
  • 1
  • 7
  • 11
0
votes
1 answer

How to get all possible value of a certain linux command?

For example, now I want to write a bash script in which I check the name of the running hosting system. The first command I would think of is uname -s. But I want to target some platform that is not available on my machine right now (like Cygwin,…
Hoang Ho
  • 13
  • 4
0
votes
1 answer

Why does php_uname show the name of the host machine?

If I run the following on my Ubuntu machine: $ uname -a Linux laptop 5.4.0-81-generic #91~18.04.1-Ubuntu SMP Fri Jul 23 13:36:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux and if I run $ docker run -i -t php:7.4-cli-alpine3.12 php -r…
0
votes
1 answer

utsname/uname in C++

I am writing a program that uses the header and the name functions to display the operating systems name, version, etc. I have included the header and have called the function, however, I am getting fatal errors stating that the…
0
votes
0 answers

How to change AIX machine number (uname -m)

On an AIX system the uname -m command "Displays the machine ID number of the hardware running the system." Where does uname get this information from ? I need to change it and I can't find any documentation on where the value comes from. This is…
Michael
  • 401
  • 5
  • 16
0
votes
2 answers

Python program running inside docker container relies upon 'uname -r'

I have a Python program that's designed to run only in certain distros of Linux (i.e. CentOS, Ubuntu, etc..). I'd like to get it running inside a CentOS7 container, but its failing because the following is returning '4.9.49-moby': import…
jersey bean
  • 3,321
  • 4
  • 28
  • 43
0
votes
3 answers

rpm spec call uname -r

When I install my app, I would like to copy some files in /lib/modules/KERNEL_VERSION/extra. The problem of course is that KERNEL_VERSION is not fixed. I can find it by calling "uname -r", but how do I do this in a rpm spec file? Also, if there's a…
Andrei S
  • 6,486
  • 5
  • 37
  • 54
0
votes
1 answer

How to compare variable to text in unix

I've tried many version of this but none of them work.I want to compare variable - here it'll be version of os, with some string. I want to check if it is bigger than indicated version. When I pass exact name it is just fine, but when I want to…