Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
15.  Displaying and Changing System Information (Tasks) Displaying System Information How to Display General System Information  Previous   Contents   Next 
   
 

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
 
 
 
  Previous   Contents   Next