System Administration Guide: Advanced Administration

Chapter 15 Displaying and Changing System Information (Tasks)

This chapter describes the tasks required to display and change the most common system information. This is a list of the step-by-step instructions in this chapter.

Displaying System Information

The following table describes commands that enable you to display general system information.

Table 15–1 Commands for Displaying System Information

Command 

Man Page 

System Information Displayed 

psrinfo

psrinfo(1M)

Processor type 

isainfo

isainfo(1)

Supported applications and it reports the number of bits supported by native applications on the running system, which can be passed as a token to scripts

showrev

showrev(1M)

Hostname, host ID, release, kernel architecture, application architecture, hardware provider, domain, and kernel version 

uname

uname(1)

Operating system name, release, and version; node name; hardware name; processor type 

hostid

hostid(1)

Host ID number 

prtconf

prtconf(1M)

Installed memory 

date

date(1)

Date and time 

How to Determine If a System Can Run the 64–bit Solaris Operating Environment

Currently, the only platform capable of supporting the 64–bit Solaris operating environment is an UltraSPARC system. To verify if a system is an UltraSPARC system, use the following command:


$ uname -m
sun4u

If the output of the uname -m command is sun4u, then the machine is an UltraSPARC system.

If you are running the Solaris 9 release, you can verify that the machine is an UltraSPARC system by using the psrinfo command:


# psrinfo -v 		
Status of processor 0 as of: 05/30/01 13:48:46
  Processor has been on-line since 05/18/01 10:02:40.
  The sparcv9 processor operates at 333 MHz,
        and has a sparcv9 floating point processor.

If the processor type is sparcv9, the platform is capable of running the 64-bit Solaris operating environment. This test does not work on previous versions of the psrinfo command, where all platforms report the less precise sparc as the processor type.

How to Determine If a System Has 64-bit Solaris Capabilities Enabled

Use the isainfo command to determine if a system has 64-bit capabilities enabled, which means that the system is booted with the 64–bit kernel.

Examples—Determining If a System Has 64–bit Solaris Capabilities Enabled

The output for an UltraSPARC system running a 32-bit kernel appears as follows:


$ isainfo -v
32-bit sparc applications

This output means that this system is capable of supporting only 32-bit applications.

The output for an UltraSPARC system running a 64-bit kernel appears as follows:


 $ isainfo -v
64-bit sparcv9 applications 
32-bit sparc applications

This output means that this system is capable of supporting both 32-bit and 64-bit applications.

Use the isainfo -b command to display the number of bits supported by native applications on the running system.

The output from a SPARC, IA, or UltraSPARC system running the 32–bit Solaris operating environment appears as follows:


$ isainfo -b
32  

The output from a 64–bit UltraSPARC system running the 64–bit Solaris operating environment appears as follows:


$ isainfo -b
64

The command returns 64 only. Even though a 64–bit UltraSPARC system is capable of running both types of applications, 64–bit applications are the best kind of applications to run on a 64–bit system.

How to Display System and Software Release Information

To display system information and software release information, use the showrev command.


$ showrev [-a]

The -a option displays all available system information.

Example—Displaying System and Software Release Information

The following example shows the showrev command output.


$ showrev -a
Hostname: starbug
Hostid: nnnnnnnn
Release: 5.9
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain: solar.com
Kernel version: SunOS 5.9 May 2002

OpenWindows version: 
X11 Version 6.4.2 11 April 2001

No patches are installed
$ 

How to Display General System Information

To display system information, use the uname command.


$ uname[-a] 

The -aoption displays the operating system name as well as the system node name, operating system release, operating system version, hardware name, and processor type.

Example—Displaying General System Information

The following example shows the uname command output.


$ uname
SunOS
$ uname -a
SunOS starbug 5.9 Generic sun4u sparc SUNW,Ultra-5_10
$

How to Display a System's Host ID Number

To display the host ID number in hexadecimal format, use the hostid command.


$ hostid

Example—Displaying a System's Host ID Number

The following example shows sample output from the hostid command.


$ hostid
80a5d34c

How to Display a System's Installed Memory

To display the amount of memory installed on your system, use the prtconf command.


$ prtconf [| grep Memory]

The grep Memory command selects output from the prtconf command to display memory information only.

Example—Displaying a System's Installed Memory

The following example shows sample output from the prtconf command.


# prtconf | grep Memory
Memory size: 128 Megabytes

How to Display the Date and Time

To display the current date and time according to your system clock, use the date command.


$ date

Example—Displaying the Date and Time

The following example shows sample output from the date command.


$ date
Thu May 31 17:44:58 MDT 2001
$

Changing System Information

This section describes commands that enable you to change general system information.

How to Set a System's Date and Time Manually

  1. Become superuser.

  2. Enter the new date and time.


    # date mmddHHMM[[cc]yy]
    

    mm

    Month, using two digits. 

    dd

    Day of the month, using two digits. 

    HH

    Hour, using two digits and a 24-hour clock. 

    MM

    Minutes, using two digits. 

    cc

    Century, using two digits. 

    yy

    Year, using two digits. 

    See date(1) for more information.

  3. Verify that you have reset your system's date correctly by using the date command with no options.

Example—Setting a System's Date and Time Manually

The following example shows how to use the date command to manually set a system's date and time.


# date
Thu Jun 21 13:59:15 MDT 2001
# date 0621141001
Thu Jun 21 14:10:00 MDT 2001

How to Set Up a Message-of-the-Day

Edit the message-of-the-day file, /etc/motd, to include announcements or inquiries to all users of a system when they log in. Use this feature sparingly, and edit this file regularly to remove obsolete messages.

  1. Become superuser.

  2. Edit the /etc/motd file and add a message of your choice.

    Edit the text to include the message that will be displayed during user login. Include spaces, Tabs, and Returns.

  3. Verify the changes by displaying the contents of the /etc/motd file.


    $ cat /etc/motd
    Welcome to the UNIX Universe. Have a nice day.

Example—Setting Up a Message-of-the-Day

The default message-of-the-day, provided when you install Solaris software, contains SunOS version information:


$ cat /etc/motd
Sun Microsystems Inc.   SunOS 5.9       Generic  May 2002

The following example shows an edited /etc/motd file that provides information about system availability to each user who logs in.


$ cat /etc/motd
The system will be down from 7:00 a.m to 2:00 p.m. on
Saturday, July 7, for upgrades and maintenance.
Do not try to access the system during those hours.
Thank you.

How to Change a System's Host Name

A system's host name is specified in several different locations.

Remember that you will need to update your name service database to reflect the new host name.

  1. Become superuser.

  2. Change the system's host name in the following files:

    • /etc/nodename

    • /etc/hostname.xxy

    • /etc/inet/hosts

    • /etc/net/ticlts/hosts

    • /etc/net/ticots/hosts

    • /etc/net/ticotsord/hosts

  3. (Optional) If using a name service, change the system's host name in the hostfile.

  4. Reboot the system to activate the new host name.


    # init 6