23.41
0
Terminal Windows and Shell Access

The most common way to access a shell from a Linux graphicalinterface isusing a Terminal window. From a graphical interface, you can often accessvirtual terminals to get to a shell. With no graphical interface, with a text- based login you are typically dropped directly to a shell after login.

NOTE    SUSE has traditionally supplied the K Desktop Environment, or KDE, as the default. Modern versions of SUSE supply both KDE anditsmain competitor, the GNOME desktop environment. The graphical examples in this book use the traditional KDE environment. Similarcommands exist within the GNOME environment.

Using Terminal Windows

To open a Terminal window from KDE (the default SUSE desktop), select the reptile menu (based on the SUSE logo) and from the default Favorites pane, select Terminal Program. This opens a konsole window, displaying a bash shell prompt. Figure 3-1 shows an example of a konsole window.

Commands shown in Figure 3-1 illustratethat the current shell is the bash shell(/bin/bash), the current user is the desktop user who launched the window (ericfj),and the current directory is that user s home directory (/home/ericfj). The username(ericfj) and hostname (Brodgar) appear in the title bar.

The konsole window not only lets you access a shell, it also has controls for managing your shells. For example, click Session New Shell to open another shell on a different tab, or click Session New Window to open a new Terminal window.

Other key sequences for controlling Terminal windows include pressing Ctrl+Shift+f to show the window in full screen mode.Type Ctrl+d to exit the shell, which closes the current tab or entire Terminal window (if it’s the last tab). The konsole window sup-ports a handy program called screen.Select New Screen Session from the Session menutolaunch the screen program in a new tab.

Thekonsole window also supports profiles (select Settings Saveas Default to savethecurrent settings as your new defaults). Some profile settings are cosmetic(allow boldtext, cursor blinks, terminal bell, colors, images, and transparency). Other settings are func- tional. For example, by default, the terminal saves 1000 scrollback lines. Some people like to be able to scroll back further and are willing to give up more memory to allow that. See all the choices on the Settings menu for details.

Ifyou launch konsole manually, you can add options.Here are some examples:

 konsole -e alsamixer                         Start  terminal with alsamixer  displayed
 konsole --vt_sz  80x20                        Start terminal 80  characters by  20  lines
 konsole --profile name                        Start  terminal using named  session  profile

Besides konsole, there are other terminal windows you can use such as xterm (basic terminal emulator that comes with the X Window System) or gnome-terminal (ter- minal emulator delivered with the GNOME desktop).The Enlightenment desktopproject offers the eterm terminal(which includes features such as message logs onthescreen background).

Using Virtual Terminals
When SUSE boots in multi-user mode (runlevel 2, 3, or 5), six virtual consoles (known as tty1 through tty6) are created with text-basedlogins. If an X Window System desktopis running, X is probably running in virtual console 7. If X isn’t running, chances are you’re looking at virtual console 1.

From X, you can switch to another virtual console with Ctrl+Alt+F1, Ctrl+Alt+F2, and so on up to F6. From a text virtual console, you can switch using Alt+F1, Alt+F2, and so on. Press Alt+F7 to return to the X GUI. Each console allows you to log in using different user accounts. Switching to look at another console doesn’t affect running processes in any of them. When you switch to virtual terminal one through six, you see a login prompt similar to the following:

Welcome   to openSUSE  10.3 (i586)   Kernel  2.6.22.5-29-default (tty2). localhostlogin:

Separate mingetty processes manage each virtual terminal. Type this command to see what mingetty processes look like before you log in to any virtual terminals:

 ps  awx| grep   -v grep   | grep   mingetty
8573   tty1
Ss+
0:00 /sbin/mingetty  --noclear tty1
8574   tty2
Ss+
0:00 /sbin/mingetty  tty2
8577   tty3
Ss+
0:00 /sbin/mingetty  tty3
8579   tty5
Ss+
0:00 /sbin/mingetty  tty5
8580   tty6
Ss+
0:00 /sbin/mingetty  tty6

After I log in on the first console, mingetty handles my login and then fires up a bash shell:

 ps  awx| grep   -v grep   | grep   tty
8573   tty1
Ss+
0:00 /sbin/mingetty  --noclear tty1
8574   tty2
Ss+
0:00 /sbin/mingetty  tty2
8577   tty3
Ss+
0:00 /sbin/mingetty  tty3
8579   tty5
Ss+
0:00 /sbin/mingetty  tty5
8580   tty6
Ss+
0:00 /sbin/mingetty  tty6
23841    tty1
Ss+
0:00  -bash

Virtual consolesare configured in the /etc/inittab  file. You can have fewer or more virtual terminals by adding or deleting mingetty lines from that file.

0 komentar:

Posting Komentar