Tutorial on Figuring out your server: OS and Name

Tech Articles
Name Services
This tutorial has examples for four versions of UNIX: Linux, Oracle’s Solaris, Apple’s Macintosh OS X and IBM’s AIX
What is my Server’s Operating System?
Many commands will vary from one version of UNIX to the next. We are using examples from four different versions of UNIX. So, to truly get a sense of where you are, first check the operating system.

To get the operating system, try one of these two commands:
uname -s
uname -a

Examples of the output from uname -s for our four sample versions of UNIX are:

Linux:
penguin [1]> uname -s
Linux

Solaris:
paloalto [1]> uname -s
SunOS

OS X:
cupertino [1]> uname -s
Darwin

AIX:
endicott[1]> uname -s
AIX

Note that uname -a gives you more information than uname –s.


What is my Server’s Name?
Two commands that give you the server’s name are:
hostname
uname -n

Some versions of UNIX, like OS X, give domain information with the output from hostname. The command hostname -s will strip the domain name from the output.

Suggestions for Future Learning
The hostname is defined in a file that the operating system reads on startup. You can probably display this file with a simple command. Other commands may be available to give you your server’s name. These are discussed in UNIX For Application Support Staff Chapter 4: Networking.



Tech Articles
Name Services
Tutorial Contents

​What is my Server's Operating System and Name ?


Name Service queries with DNS and NIS

IP Addresses


What Is My Server’s Configuration ?

Hardware Information : CPU and Memory

Environmental Variables : Your Configuration


Disk Usage  and Listing Directory Contents

Who Else  is Logged in?