📄 101-106.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=101-106//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch05/098-100.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="106-109.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2 ALIGN="CENTER"><FONT COLOR="#000077"><I>Part II<BR>Getting to Know Linux
</I></FONT></H2>
<DL>
<DT><B>In This Part</B>
<DT>• Getting Started
<DT>• Basic Linux Commands
<DT>• Using the File System
<DT>• File and Directory Permissions
<DT>• GNU Project Utilities
<DT>• bash
<DT>• pdksh
<DT>• tcsh
<DT>• Shell Programming
<DT>• FTP and Telnet
</DL>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 6<BR>Getting Started
</FONT></H2>
<P><I>by Ed Treijs and Tim Parker</I></P>
<DL>
<DT><B>In This Chapter</B>
<DT>• Starting and stopping your Linux system
<DT>• What’s this about “logging in”?
<DT>• Passwords
<DT>• Creating a new login
<DT>• Logging out
<DT>• Trying out your new login
<DT>• The who command
<DT>• Virtual terminals
<DT>• Command and programs
</DL>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Starting and Stopping Your Linux System</FONT></H3>
<P>The startup phase of Linux depends on the configuration of LILO that you chose during your Linux installation. In the simplest case, Linux starts automatically from your hard drive or from a boot floppy disk. If your system has multiple versions of Linux or other operating systems installed, you will have to enter a boot string to start Linux.
</P>
<P>When your Linux system starts up, you see quite a few Linux initialization messages scroll across the screen. These are system messages that indicate the hardware that Linux recognizes and configures, as well as all the software drivers it loads when starting up. When Linux completes its startup sequence, you should see a prompt similar to this one:</P>
<!-- CODE SNIP //-->
<PRE>
darkstar login:
</PRE>
<!-- END CODE SNIP //-->
<P>You will probably see another name before the login prompt, which in most versions of Linux is set when you install the software. Some Linux systems also show the current version number of the software when the login prompt is displayed, like this:
</P>
<!-- CODE SNIP //-->
<PRE>
Welcome to Linux 1.2.13darkstar login:
</PRE>
<!-- END CODE SNIP //-->
<P>Don’t worry if your prompt doesn’t look exactly like this because each version of Linux does it a bit differently. You will get some sort of a prompt—such as a dollar sign—with every version, though.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Warning: </B><BR>A Linux system must always be shut down properly. Improper shutdown, usually caused by simply turning off your system at the power switch, can cause serious damage to your Linux filesystem! When you are finished using your Linux system, you must shut it down properly as described in the next section. If you start to boot up Linux and then change your mind, you should let the system start up fully and then follow the shutdown procedure. You risk losing files or your entire system if you fail to follow this advice!<HR></FONT>
</BLOCKQUOTE>
<P>You already know how to start Linux, but it is even more important to know how to shut down the system properly. Like many multiuser systems such as UNIX and Windows NT, if Linux is not powered down properly, damage to individual files or the entire filesystem can result. This is caused by Linux keeping more current versions of the disk’s table of contents (known as the I-node table) in memory in order to speed disk access. When you shut down the system properly, the memory version of the I-node table is written to disk prior to the system halting. If you power down without writing the memory version of the I-node table to disk, the disk’s contents may not be correct and files may be lost. Also, since Linux is continually using the disk drives even when you are not using the system, it’s possible that a disk write-protect could get interrupted when you power off manually. Shutting down the system properly causes all disk writes to cease.
</P>
<P>The easiest way to ensure a proper shutdown is to press the <TT>Ctrl+ Alt+Delete</TT> keys simultaneously. (This is the famous <TT>Ctrl+Alt+Delete</TT> “three-finger salute” used in DOS and Windows.) Pressing <TT>Ctrl+Alt+Delete</TT> causes a number of advisory messages and Linux shutdown messages to be displayed. When the Linux shutdown procedure has finished, your monitor shows either the initial “power-on” screen or a shutdown message before turning your computer off. Since the shutdown process takes Linux only a few seconds, this is not time-consuming. It’s fast and easy, and maintains your system’s integrity.</P>
<P>One quick warning: If any users are logged in to your Linux system when you do the <TT>Ctrl+Alt+Delete</TT> sequence, they will be logged off rather forcefully and possibly lose whatever they were working on. Use the <TT>Ctrl+Alt+Delete</TT> sequence with care, and try to tell everyone to log off if they are using the system. You can use the <TT>who</TT> command to find out who is logged in (see “The <TT>who</TT> Command” section found later in this chapter).</P>
<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">Linux Shutdown Commands</FONT></H4>
<P>There are several other ways to shut down the system, but the <TT>Ctrl+Alt+Delete</TT> sequence is probably the easiest. A number of other commands can activate the shutdown process, but they vary, depending on the version of Linux you are using. Commonly used commands are <TT>shutdown</TT>, <TT>haltsys</TT>, and <TT>fasthalt</TT>. Experiment with your particular Linux version to find out which commands are supported.</P>
<P>The second most commonly used method of shutting down Linux (aside from <TT>Ctrl+Alt+ Delete</TT>) is none other than the <TT>shutdown</TT> command. The syntax usually allows you to specify several parameters, such as the amount of time before Linux shuts down and whether to reboot immediately. Practically every Linux version of <TT>shutdown</TT> requires an argument that indicates the number of seconds to wait before starting the shutdown procedure. For example, the command:</P>
<!-- CODE SNIP //-->
<PRE>
shutdown -t45
</PRE>
<!-- END CODE SNIP //-->
<P>tells Linux to wait 45 seconds before starting the shutdown process. The time argument often requires the <TT>-t</TT> option ahead of it, but some versions assume any number is the number of seconds. If you want to start the shutdown process immediately, you can set the number of seconds to zero or on some systems type the word <B>now</B>:</P>
<!-- CODE SNIP //-->
<PRE>
shutdown now
</PRE>
<!-- END CODE SNIP //-->
<P>An <TT>-r</TT> option tells Linux to reboot after shutting down. This can be handy when you want to load new configuration information such as device drivers. There are several other options supported by <TT>shutdown</TT>. Usually, you can find them by simply typing <B>shutdown</B> with no arguments and checking the error message that appears. Alternatively, the main page will have a list of supported options, too.</P>
<P>The <TT>fasthalt</TT> and <TT>haltsys</TT> commands are left over from other versions of UNIX but have been implemented in some Linux releases. Both commands do as their names imply and quickly shut the system down.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch05/098-100.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="106-109.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 + -