Linux Tips

Posted: September 22, 2010 in REDHAT 5 LinUX

Multiple Virtual Terminal access

There are normally 6 virtual terminals in Linux, available by using Alt-F1 through Alt-F6. Each one can be logged in as a different user. There are normally 6 terminals available in X also, F7 through F12. The first X session will be on F7 (if on a local terminal), the second on F8, and so forth. If an X session is started from F1 and you also have an active session on F2, you can type Ctrl-Alt-F2 to go from the X session to the virtual console on F2. Also to get back to your X session, you can type Ctrl-Alt-F7. This example assumes that your terminals are setup in the standard manner with 6 virtual terminals that spawn the getty program available. You can check your setup by checking your /etc/inittab file. You should have lines like the following in your file.

1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

See the section on init for further information on this file.

Linux Command line shortcuts

If typing a command on the command line, you can press <TAB> before the command is complete and if there are enough characters for it to be unique, the system will finish the command for you. If it is not yet unique, and <TAB> is pressed twice, you will be given choices.

Pasting text in files

There is a cut and paste mouse utility that works with virtual consoles called gpm which runs as a daemon. To use it,

  1. Move your mouse to the text you want to cut or paste
  2. Hold the left mouse button down
  3. Drag the mouse to the end of the selected text
  4. Release the mouse button
  5. If deleting text, just press the “DEL” key for your final step. If pasting text, move the text cursor to the location you want to paste to by switching terminals with function keys, using arrow keys, etc.
  6. If pasting, press the right mouse button.

Viewing previously displayed text

Text that has scrolled off the top of the screen may be viewed again using the <SHIFT><PgUp> key combination. The Keys in the numbers section on the far right of the keypad do not work for this function, only the grey PgUp and PgDn keys just to the right of the <Enter> key. If you want other keys to perform this function, it would be necessary to map them for bash shell keymapping. Pressing any other key other than <SHIFT><PgUp> or <SHIFT><PgDn> will bring you back to the normal screen location.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s