📄 335-339.html
字号:
<HTML>
<HEAD>
<TITLE>Special Edition Using Linux, Fourth Edition:Understanding Linux Shells</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0789717468//-->
<!--TITLE=Special Edition Using Linux, Fourth Edition//-->
<!--AUTHOR=Jack Tackett//-->
<!--AUTHOR=Jr.//-->
<!--AUTHOR=Steve Burnett//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=18//-->
<!--PAGES=335-339//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch17/331-334.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="339-341.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2 ALIGN="CENTER"><FONT COLOR="#000077"><I>PART IV<BR>Working with Linux
</I></FONT></H2>
<DL>
<DT>18 Understanding Linux Shells
<DT>19 Managing Multiple Processes
<DT>20 Printing
<DT>21 Installing the X Windows System
<DT>22 Using X Windows
</DL>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 18<BR>Understanding Linux Shells
</FONT></H2>
<P><I>by Steve Burnett</I></P>
<DL>
<DT><B><BIG>I</BIG>n this chapter
</B><DT>Logging In
<DT>Understanding Shells
<DT>Understanding Shell Command Parsing
<DT>Doing Background Processing
<DT>Understanding Command Feedback
<DT>Editing and Aliasing Shell Commands
<DT>Working with Shell Scripts
<DT>Customizing Linux Shells
</DL>
<P>Although graphical interfaces have been added to the UNIX system in recent years, most of the utilities for using and administering Linux (and other UNIX-like systems) are run by typing commands. In Linux, the command-line interpreter is called the <BIG>shell</BIG>. This chapter describes how to use the features of the various shells to work with Linux utilities and file systems.</P>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Logging In</FONT></H3>
<P>As a new user and novice system administrator on your Linux system, you’ve chosen a login ID and password. Because Linux is a multiuser operating system, it must be able to distinguish between users and classes of users. Linux uses your login ID to establish a session in your name and determine the privileges you have. Linux uses your password to verify who you are.
</P>
<P>Because any user can log in to any terminal in theory (there is an exception), the UNIX operating system begins by displaying a login prompt on every terminal. Because it’s unlikely you’ll have multiple terminals connected to your initial Linux system (although connecting multiple terminals is certainly possible), you’ll have the alternate, or virtual, terminals available to you.</P>
<P>To switch to the various virtual terminals, press the <Alt> key and any of the first six function keys to switch between the various virtual terminals. For example, to log in to virtual terminal one as root, press <Alt-F1>, which displays the following prompt:</P>
<!-- CODE SNIP //-->
<PRE>
Red Hat Linux release 5.1 (Manhattan)
Kernel 2.0.34 on an i686
login:
</PRE>
<!-- END CODE SNIP //-->
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>The prompt line in the code line declares this example session to be running under the 2.0.34 version of the Linux kernel. As newer kernels are released, this number is incremented, so you may see a different version on the accompanying CD-ROMs. The stable released kernels are given even numbers for the middle number and the odd numbers indicate the latest (and beta) releases.<HR></FONT>
</BLOCKQUOTE>
<P>Enter your user ID (root) and password.
</P>
<P>When you log in to any terminal, you own the session on that terminal until you log out. When you log out, Linux displays the login prompt for the next user. Between logging in and logging out, Linux makes sure that all the programs you run and any files you might create are owned by you. Conversely, Linux doesn’t allow you to read or alter a file owned by another user unless that user or the system administrator has given you permission to do so. Your login ID and password allow Linux to maintain the security of your files and those of others.</P>
<P>As the system administrator for your Linux system, you assign every user a user ID, temporary password, group ID, home directory, and shell. This information is kept in a file named /etc/passwd, which is owned and controlled by the system administrator, also known as root or the superuser. After you successfully log in, you can change your password, which is then encrypted in a form that no one else can read. If you forget your password, you (the system administrator) have to log in as the root user to create a new password. You can change your own password with the <TT>passwd</TT> command (although you have to type in the old password).</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>For more information on basic system administration duties, such as adding users and fixing forgotten passwords, see the chapters in Part II, “System Administration,” particularly Chapter 10, “Managing User Accounts.”<HR></FONT>
</BLOCKQUOTE>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Understanding Shells</FONT></H3>
<P>After you log in, Linux places you in your home directory and runs a program called a <BIG>shell</BIG>. A shell is really nothing more than a program designed to accept commands from you and execute them. Many kinds of programs can be used as shells, but several standard shells are available with almost all versions of Linux.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>Linux shells are equivalent to COMMAND.COM used by MS-DOS. Both accept and execute commands, run batch files, and execute programs.<HR></FONT>
</BLOCKQUOTE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch17/331-334.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="339-341.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 + -