Home > Unix > UNIX – Lesson 019 – hostname and uname commands

UNIX – Lesson 019 – hostname and uname commands


hostname
The “hostname” command sets or prints name of current host system 

Syntax :
hostname

Example:
$hostname
itctnss0123

================================================================================
uname

The “uname” command prints name of current system

Syntax :
uname [ -aimnprsv ]

Key arguments:

  • -a   Prints basic information currently available from the system.
  • -i    Prints the name of the hardware implementation (platform).
  • -m  Prints the machine hardware name (class). Use of this option discouraged; use uname -p instead.
  • -n   Prints the nodename (the nodename is the name by which the system is known to a communications network).
  • -p   Prints the current host’s ISA or processor type. Prints the operating system release level.
  • -r    Prints the operating system release level.
  • -s    Prints the name of the operating system. This is the default.
  • -v    Prints the operating system version.

Example:
# uname -a
SunOS itctnss0123 5.8 Generic_117350-43 sun4u sparc SUNW,Ultra-60

# uname -i
SUNW,Ultra-60

# uname -m
sun4u

# uname -n
itctnss0123

# uname -p
sparc

#uname -r
5.8

# uname -s
SunOS

# uname -v
Generic_117350-43

# uname –rs
SunOS 5.8

Categories: Unix
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: