Modifying the /etc/inittab file

Four commands are available to modify the records in the etc/inittab file.

Adding records - mkitab command

To add a record to the /etc/inittab file, type the following at a command prompt:
mkitab Identifier:Run Level:Action:Command
For example, to add a record for tty2, type the following at a command prompt:
mkitab tty002:2:respawn:/usr/sbin/getty /dev/tty2

In the above example:

Item Description
tty002 Identifies the object whose run level you are defining.
2 Specifies the run level at which this process runs.
respawn Specifies the action that the init command should take for this process.
/usr/sbin/getty /dev/tty2 Specifies the shell command to be executed.

Changing records - chitab command

To change a record to the /etc/inittab file, type the following at a command prompt:
chitab Identifier:Run Level:Action:Command
For example, to change a record for tty2 so that this process runs at run levels 2 and 3, type:
chitab tty002:23:respawn:/usr/sbin/getty /dev/tty2

In the above example:

Item Description
tty002 Identifies the object whose run level you are defining.
23 Specifies the run levels at which this process runs.
respawn Specifies the action that the init command should take for this process.
/usr/sbin/getty /dev/tty2 Specifies the shell command to be executed.

Listing records - lsitab command

To list all records in the /etc/inittab file, type the following at a command prompt:
lsitab -a
To list a specific record in the /etc/inittab file, type:
lsitab Identifier

For example, to list the record for tty2, type: lsitab tty2.

Removing records - rmitab command

To remove a record from the /etc/inittab file, type the following at a command prompt:
rmitab Identifier

For example, to remove the record for tty2, type: rmitab tty2.