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
36
votes
2 answers

Verify the version of ubuntu running in a Docker container

I have Docker Toolbox installed on windows 8.1 and I am creating an image based on ubuntu:latest (which should be 16.04). I want to make sure that my application is indeed run on 16.04. Here is my Dockerfile: FROM ubuntu:latest MAINTAINER xyz…
Cola
  • 2,097
  • 4
  • 24
  • 30
31
votes
2 answers

$(uname -a) returning the same in docker host or any docker container

Why $(uname -a) returns the same Linux kernel than the host machine inside a docker container? uname -a #=> Linux leo 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux docker run -ti --rm…
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
21
votes
4 answers

How to strip trailing whitespace in CMake variable?

We are trying to improve the makefiles produced by CMake. For Clang, GCC and ICC, we want to add -march=native. The block to do so looks like: # -march=native for GCC, Clang and ICC on i386, i486, i586, i686 and x86_64. message(STATUS,…
jww
  • 97,681
  • 90
  • 411
  • 885
19
votes
1 answer

Understanding uname output

What do the various pieces of uname -a output mean? Following is an example output: Linux mymachine 2.6.18-194.e15PAE #1 SMP Fri Apr 2 15:37:44 EDT 2010 i686 i686 i386 GNU/Linux I gather that Linux is the O.S, 2.6.18-194.e15PAE is the kernel…
septerr
  • 205
  • 1
  • 2
  • 4
16
votes
4 answers

C how to use the function uname

I should write a function to get some information about the system (the most important information is the the architecture). I found the function uname which can be used including sys/utsname.h. Well, though I googled and I read the documentation, I…
En_t8
  • 7,595
  • 5
  • 20
  • 14
14
votes
1 answer

How to change version string of the kernel?

I'm very new to Linux and very new to building/compiling my own kernel. For starters, I'm just trying to figure out how to change the version string of my kernel. For instance, when I do uname -a, it prints out "Linux localhost.localdomain…
pfinferno
  • 1,779
  • 3
  • 34
  • 62
13
votes
2 answers

How to find port number for a particular process id in unix?

In UNIX OS, how can I find the port number when i know the process name or pid ?
user1857216
  • 147
  • 1
  • 1
  • 3
11
votes
16 answers

What does YOUR uname say?

Short story: I need to write a PHP script which finds the correct OS type from uname (eg: both wince and winnt would return windows). See here for more info. Shouldn't this be a community wiki? Yes but...see here. How to help: If your OS is not…
Christian
  • 27,509
  • 17
  • 111
  • 155
7
votes
2 answers

Detect OS from Bash script and notify user

Using bash, I want to find the operating system and notify the user. I tried: OS='uname -s' echo "$OS" if [ "$OS" == 'Linux' ]; then echo "Linux" else echo "Not Linux" fi I just get uname -s Not Linux on the terminal, which is wrong. How…
Graham
  • 541
  • 2
  • 5
  • 13
6
votes
4 answers

Identifying If the OS is (Open)SUSE in Python?

I'm developing a script that needs the package managers of a System. I've identified Fedora, Gentoo, and Arch Linux using the os.uname() function. However, the (open)SUSE uname results is the same as other Linux Distros. I found the uname results of…
ant0nisk
  • 581
  • 1
  • 4
  • 17
5
votes
1 answer

What are different possible values for POSIX::uname() release number on Windows?

I want to determine which version of Windows I'm on using POSIX::uname. I know it returns 6.2 on Windows 2012. I found a table of these values, Windows version and corresponding release number but I can't find it anymore. I've been searching the…
hmatt1
  • 4,939
  • 3
  • 30
  • 51
3
votes
1 answer

SOLARIS - verify OS version before OS upgarde

I have SOLARIS 10 OS SOLARIS OS was upgrade to new version as the following version - 144488-02 Example of OS version verification: uname -v Generic_144488-02 . uname -a SunOS star1a 5.10 Generic_144488-02 sun4v sparc…
user1121951
3
votes
1 answer

How to detect Linux or macOS or Windows in powershell?

I use uname -s in bash scripts to determine the OS and it returns Linux, Darwin or MINGW64_NT... when its running on Linux, macOS or Windows. EDIT0 : I want my $PROFILE script to detect the OS whether is running on Windows with PS (version could be…
SebMa
  • 4,037
  • 29
  • 39
3
votes
2 answers

Calling uname from libc with Pythons ctypes

tl;dr this works with the GNU version of libc (haven't tried it with uclibc yet) from ctypes import * libc = CDLL('libc.so.6') class uts_struct(Structure): _fields_ = [ ('sysname', c_char * 65), ('nodename', c_char * 65), …
tMC
  • 18,105
  • 14
  • 62
  • 98
3
votes
2 answers

Issue with uname when trying to launch atom from MSYS shell

I have recently installed Atom, and made sure the path is correct, however, when calling any command such as atom file_name, or atom . I am met with uname: invalid option -- o Try "uname --help" for more information. "esources" is not recognized as…
A. McLeod
  • 31
  • 2
1
2 3 4