[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 5

swcons Command

Purpose

Redirects, temporarily, the system console output to a specified device or file.

Syntax

swcons PathName

Description

The swcons command temporarily switches the system console output to a different target during system operation. This command only switches system informational-, error-, and intervention-required message output to the specified destination. The swcons command does not affect the operation of the system console device that is providing a login by way of the getty command.

The device or file specified when using this command remains the target for console output until changed by another swcons command, until the next start of the system, or until the console driver detects an error when accessing the designated device or file. If an open or write error is detected on the device or file specified by the swcons command, the console device driver switches all output back to the device or file that provided console support when the system was last started.

The PathName parameter must be a fully qualified path name to a device or file that is to receive system console message output. If the PathName parameter specifies a file that does not exist, the swcons command creates the file. If the file does exist, the swcons command appends any new console message output to the contents of the file.

Attention: Use of the swcons command to switch console output to an NFS mounted file system may cause the operating system to hang.

Examples

  1. To change the system console message output to a file called console.out in the /tmp directory, enter:
    swcons /tmp/console.out
  2. To change the system console message output to a terminal with the logical name tty3, enter:
    swcons /dev/tty3
  3. To change the system-console message output back to the device or file that supported the console output at system start time, enter:
    swcons

Files

/dev/console Specifies the special file for system console access.
/usr/sbin/swcons Contains the swcons command file.

Related Information

The chcons command, lscons command.

The console special file.


[ Previous | Next | Contents | Glossary | Home | Search ]