📄 122-124.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Getting Started</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=6//-->
<!--PAGES=122-124//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="119-122.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch07/125-128.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading14"></A><FONT COLOR="#000077">Virtual Terminals</FONT></H3>
<P>Linux, as mentioned earlier, is a multiuser, multitasking system. This means that more than one login can access the system at the same time and that each login can be doing one or more different things all at the same time. A serious multiuser system has several terminals (consisting of a keyboard and a display screen) wired or networked to the main computer unit.
</P>
<P>Although you probably don’t have any terminals attached to your system, you can still log in several times under the same or different login names using your single keyboard and screen. This magic is performed by using <I>virtual terminals</I> which allow your single screen and keyboard to act like a dozen different terminals, each identified by one of the function keys located at the top of your keyboard.</P>
<P>As an example, press <TT>Alt+F2</TT>. When you do, everything on your screen should disappear, to be replaced by the following:</P>
<!-- CODE SNIP //-->
<PRE>
Welcome to Linux 1.2.13
darkstar login:
</PRE>
<!-- END CODE SNIP //-->
<P>Log in with your “regular” login (not <TT>root</TT>). When the shell prompt is displayed, type <TT>who</TT> at the prompt and press Enter. You should see something similar to the following:</P>
<!-- CODE SNIP //-->
<PRE>
darkstar:~$ who
fido tty2 Dec 14 01:42
fido tty1 Dec 14 01:40
</PRE>
<!-- END CODE SNIP //-->
<P>When you run the Linux command <TT>who</TT>, your screen displays the names of all logins currently logged into the system, where they are logged in from, and when they logged in. (Your login name appears, of course, instead of <TT>fido</TT> in the preceding example.)</P>
<P>By convention, <TT>tty1</TT> is the main console screen. It is the “normal” screen that appears after Linux has started up (unless you start up with a windowing interface), so you don’t have to do anything special to get it. If you have switched to any other virtual consoles, you can return to <TT>tty1</TT> by pressing <TT>Alt+F1</TT>.</P>
<P>So you want to know how many virtual screens are active on your system? Try going through all the Alt+F<I>n</I> keys. Alternatively, on some systems you can scroll through the virtual screens by using the <TT>Alt+right</TT> arrow combination to move up through the screens or <TT>Alt+left</TT> arrow to move down. Most Linux systems start with either six, ten, or twelve virtual consoles defined. You can change this number, but you’ll probably never use more than three or four, so the default is fine.</P>
<P>Why bother with virtual consoles? Quite often you find yourself doing something—perhaps in a long and complicated program—and realize that you should have done something else first. Simply flip to another virtual terminal and do whatever it is. It’s as if you have two terminals running at the same time.</P>
<P>Another handy use of virtual terminals is when, through experimentation or otherwise, your screen locks up or starts displaying strange symbols when you hit a key. From a different virtual terminal, you can try to troubleshoot the problem or restart the system, if necessary.</P>
<P>Linux also comes with a very powerful multitasking windowing environment called X. Installing and running X window systems is described later in this book (see Chapter 22, “Installing and Configuring XFree86”).</P>
<H3><A NAME="Heading15"></A><FONT COLOR="#000077">Commands and Programs</FONT></H3>
<P>“Run the <TT>who</TT> command” and “Run <TT>who</TT>” are much more common ways of saying “Type <TT>who</TT> at the prompt and press Enter.” We use the shorter expressions wherever their meaning is clear. Sometimes people familiar with Linux drop the word “run” so that one user might tell another, “I tried <TT>who</TT> but didn’t see anything unusual.” It’s understood by the context that when they “tried <TT>who</TT>,” they actually “ran” it.</P>
<P>Something else you may notice if you are reading carefully is that there seems to be both Linux <I>programs</I> and Linux <I>commands</I>. A command is that which you type at the shell prompt. For this reason, the combination of the shell prompt and what you type after it is often called a <I>command line</I>. When you press the Enter key, Linux takes the command you’ve entered and tries to perform it. The Linux system has built-in responses to some commands; for other commands, it finds the appropriately named program on your hard disk and executes that program.</P>
<P>In the strictest sense, then, the command is what you type, and the program is what performs your command. However, very simple programs with straightforward results, such as <TT>who</TT>, are often referred to as commands, although there is actually a <TT>who</TT> program on your hard disk. More complicated programs, usually interactive ones such as <TT>adduser</TT> or open-ended ones such as a text editor, are called programs in the more traditional sense. So you might hear one experienced user tell another, “The <TT>adduser</TT> program worked fine. I tried the <TT>who</TT> command 15 minutes later and the new user had logged in already.”</P>
<H3><A NAME="Heading16"></A><FONT COLOR="#000077">Summary</FONT></H3>
<P>In this chapter, we assigned a password to the <TT>root</TT> login and created a new user ID to be used in the next few chapters. We learned some useful Linux terminology tips that will serve us well in the future. At this point, you can either ensure that you have logged out of all virtual terminals or simply move on to the next chapters.</P>
<P>There are a number of chapters that explain in detail what we’ve just covered, and you may want to read them right now for more information:</P>
<DL>
<DD>To learn more about Linux commands you’ll use on a regular basis, see Chapter 7, “Basic Linux Commands.”
<DD>To learn more about the Bourne Again Shell that you use by default, see Chapter 11.
<DD>And to learn more about file permissions and the way they affect which files you can read, see Chapter 9.
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="119-122.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch07/125-128.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -