Previous Table of Contents Next


Determining How Long a System Has Been Up (uptime)

To find out how long a system has been up, type uptime and press Return. The time, number of users, and load average are displayed for the local system:

castle% uptime
  1:16pm  up  4:57,  1 user,  load average: 0.12, 0.06, 0.04
castle%

To find out when a system was booted, type who -b and press Return. The month, day, and time of the last boot are displayed:

oak% who -b
 . system boot Jul 14 Ø8:49
oak%

Determining the System Date and Time (date)

To display the system date and time, type date and press Return. The system date and time are displayed:

castle% date
Tue Sep 16 13:17:03 PDT 1997
castle%

Setting the System Date and Time (date)

Follow these steps to reset the system date and time:

6.  Become superuser.
7.  Type date mmddhhmmyy and press Return, where mm is the month, dd is the day, hh is the hour, mm is the minute, and yy is the year. The system date and time are reset using the month, day, hour, minute, and year that you specify:
     # su
     Password:
     # date
     Tue Jul 14 16:Ø7:Ø1 PST 1992
     # date Ø7141552
     Tue Jul 14 15:52:ØØ PST 1992
     #

Changing the System Time Zone (/etc/TIMEZONE)

The time zone is set in the /etc/TIMEZONE file. The available U.S. time zone variables are shown below. Look in the /usr/share/ lib/zoneinfo directory for a complete list of time zone variables.:

US/Arizona
US/Central
US/East-Indiana
US/Hawaii
US/Mountain
US/Pacific
US/Pacific-New
US/Yukon

Follow these steps to change the system time zone:

1.  Become superuser.
2.  Edit the /etc/TIMEZONE file, change the TZ=time-zone variable, and save the changes. The time zone is reset.
3.  Reboot the system.

Here is an example of the /etc/TIMEZONE file for a system set to Pacific Standard/Pacific Daylight Time. Note that /etc/TIMEZONE is now a symbolic link to /etc/default/init:

castle% more /etc/TIMEZONE
# @(#)init.dfl 1.2 92/11/26
#
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.
# This file looks like a shell script, but it is not.  To maintain
# compatibility with old versions of /etc/TIMEZONE, some shell constructs
# (i.e., export commands) are allowed in this file, but are ignored.
#
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, or any of the LC_* environment variables.
#
TZ=US/Pacific
castle%

Here is an example of how to change the time zone from Pacific to Eastern:

oak% su
Password:
# vi /etc/TIMEZONE
TZ=US/East-Indiana;export TZ
:w!
# reboot
oak% date
Tue Jul 14 14:24:52 EST 1992
oak%


NOTE:  You may need to make your text editor do a confirmed write of the file. For example, in vi use the command :w! to write the changes even if the permissions normally would not allow it.

Configuring Additional Swap Space (mkfile, swap)

To create and add additional swap space without reformatting a disk, first you create a swap file using the mkfile command. You can specify the size of the swap file in kilobytes (the default) or in blocks or megabytes by using the b and m suffixes, respectively. The swap file can either be on a local disk or be NFS-mounted. Then you add the swap space using the swap command.

To list available swap files, type swap -l and press Return. A list of available swap files is displayed. The swap command replaces the SunOS 4.x swapon command:

drusilla% swap -l
swapfile             dev  swaplo blocks   free
swapfs                -        Ø  9452Ø  93512
/dev/dsk/cØt3dØs1   32,25      8  65512  45Ø48
drusilla%

Follow these steps to create a swap file:

1.  Become superuser. You can create a swap file without root permissions, but it is a good idea to have root be the owner of the swap file so that other processes cannot access it.
2.  Type mkfile nnn[k|b|m] file-name and press Return. The letter following the number you specify indicates kilobytes, blocks, or megabytes. The swap file of the size and file name you specify is created. In this example, you create a 1-Mbyte swap file named SWAP:
        oak% su
        Password:
        # mkfile 1m /files1/SWAP
        #


Previous Table of Contents Next