-->

Accessing CLI via a Linux Console Terminal

In the early days of Linux, when you booted up your system you would see a login prompt on your monitor, and that’s all. As mentioned earlier, this is called the Linux console. It was the only place you could enter commands for the system.

Even though several virtual consoles are created at boot time, many Linux distributions switch to a graphical environment after the boot sequence completes. This provides the user with a graphical login and desktop experience. Therefore, in this case, accessing a virtual console is done manually.

In most Linux distributions, you can access one of the Linux virtual consoles using a simple keystroke combination. Usually, you must hold down the Ctrl+Alt key combination and then press a function key (F1 through F7) for the virtual console you want to use. Function key F2 produces virtual console 2, key F3 produces virtual console 3, key F4
produces virtual console 4, and so on.

Note:

Linux distributions typically use the Ctrl+Alt key combination with either F1 or F7 to
reach the graphical interface. Ubuntu uses F7, while RHEL uses F1. It is best to test
and see where your distribution puts the graphical interface.

Text mode virtual consoles use the whole screen and start with the text login screen displayed. An example of a text login screen from a virtual console is shown in picture below.

Linux virtual console login screen
Linux virtual console login screen



Notice in Figure the words tty2 at the end of the first text line. The 2 in tty2 indicates that it is virtual console 2 and was reached by pressing the Ctrl+Alt+F2 key sequence. tty stands for teletypewriter. Teletypewriter is an old term, indicating a machine used for sending messages.

Note:

Not all Linux distributions show the virtual console’s tty number at the login screen.
You log into a console terminal by entering your user ID after the login: prompt and
typing your password after the Password: prompt. If you have never logged in this way
before, be aware that typing your password is a different experience than in a graphical
environment. In a graphical environment, you may see dots or asterisks indicating the
password characters as you type. However, at the virtual console, nothing is displayed
when you type your password.

After logging into a virtual console, you are taken to the Linux CLI. Keep in mind that, within the Linux virtual console, you do not have the ability to run any graphical programs.

After you have logged in to a virtual console, you can keep it active and switch to another virtual console without losing your active session. You can switch between all the virtual consoles, with multiple active sessions running. This feature provides a great deal of flexibility while you work at the CLI.

Additional flexibility deals with the virtual console’s appearance. Even though it is a text mode console terminal, you can modify the text and background colors.

For example, it may be easier on your eyes to set the background of the terminal to white and the text to black. After you have logged in, you can accomplish this modification in a couple of ways. One way is to type in the command setterm -inversescreen on and press the Enter key, as shown in the picture below, Notice in the figure that the inversescreen feature is being turned on using the option on. You can also turn it off using the off option.

Linux virtual console with inversescreen being turned on
Linux virtual console with inversescreen being turned on



Another way is to type two commands, one after the other. Type setterm -background white and press Enter, and then type setterm -foreground black and press Enter. Be careful because, when you change your terminal background first, it may be hard to see the commands you are typing.

With the commands in the preceding paragraph, you are not turning features on and off, as with inversescreen. Instead, you have a choice of eight colors. The choices are black, red, green, yellow, blue, magenta, cyan, and white (which looks gray on some distributions). You can get rather creative with your plain text mode console terminals.

The Table shows some options you can use with the setterm command to help improve your console terminal’s readability or appearance.



setterm Options for Foreground and Background Appearance
setterm Options for Foreground and Background Appearance


Virtual console terminals are great for accessing the CLI outside the GUI. However, sometimes, you need to access the CLI and run graphical programs. Using a terminal emulation package solves this problem and is a popular way to access the shell CLI from within the GUI. The following sections describe common software packages that provide graphical terminal emulation.

Accessing CLI via Graphical Terminal Emulation

The graphical desktop environment offers a great deal more variety for CLI access than the virtual console terminal does. Many graphical terminal emulator packages are available for the graphical environment. Each package provides its own unique set of features and options. Some popular graphical terminal emulator packages are shown in Table below along with their websites.

The Table with Popular Graphical Terminal Emulator Packages

  1. Eterm: http://www.eterm.org
  2. Final Term: http://finalterm.org
  3. GNOME Terminal: https://help.gnome.org/users/gnome-terminal/stable
  4. Guake: https://github.com/Guake/guake
  5. Konsole Terminal: http://konsole.kde.org
  6. LillyTerm: http://lilyterm.luna.com.tw/index.html
  7. LXTerminal: http://wiki.lxde.org/en/LXTerminal
  8. mrxvt: https://code.google.com/p/mrxvt
  9. ROXTerm: http://roxterm.sourceforge.net
  10. rxvt: http://sourceforge.net/projects/rxvt
  11. rxvt-unicode: http://software.schmorp.de/pkg/rxvt-unicode
  12. Sakura: https://launchpad.net/sakura
  13. st: http://st.suckless.org
  14. Terminator: https://launchpad.net/terminator
  15. Terminology: http://www.enlightenment.org/p.php?p=about/terminology
  16. tilda: http://tilda.sourceforge.net/tildaabout.php
  17. UXterm: http://manpages.ubuntu.com/manpages/gutsy/man1/uxterm.1.html
  18. Wterm: http:/r/souceforge.net/projects/wterm
  19. xterm: http://invisible-island.net/xterm
  20. Xfce4: Terminal http://docs.xfce.org/apps/terminal/start
  21. Yakuake: http://extragear.kde.org/apps/yakuake

Although many graphical terminal emulator packages are available, the focus in this chapter is on three commonly used ones. Often installed in Linux distributions by default, they are GNOME Terminal, Konsole Terminal, and xterm.


0 Response to "Accessing CLI via a Linux Console Terminal"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel