📄 ch01_26.htm
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 1] 1.26 What a Multiuser System Can Do for You </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly & Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly & Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:31:35Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch01_01.htm"TITLE="1. Introduction"><LINKREL="prev"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "><LINKREL="next"HREF="ch01_27.htm"TITLE="1.27 How Background Processing Works "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 1.25 Access to Directories "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 1<BR>Introduction</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_27.htm"TITLE="1.27 How Background Processing Works "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.27 How Background Processing Works "BORDER="0"></A></TD></TR></TABLE> <HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-1015">1.26 What a Multiuser System Can Do for You </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-2308"></A>Even if you are the only user, a multiuser system can do a lot ofthings for you that a simpler operating system can't. For one thing,you can run several programs at the same time: you don't have to waitfor one program to finish before you start the next. Even if youdon't have a<SPANCLASS="link">fancy windowing terminal or a workstation (<ACLASS="linkend"HREF="ch01_31.htm"TITLE="The X Window System ">1.31</A>)</SPAN>,you can stillrun jobs in the<SPANCLASS="link"><EMCLASS="emphasis">background</EM> (<ACLASS="linkend"HREF="ch01_27.htm"TITLE="How Background Processing Works ">1.27</A>)</SPAN>.<ACLASS="indexterm"NAME="UPT-ART-1015-IX-JOBS-AND-JOB-CONTROL-BACKGROUND-PROCESSING"></A><ACLASS="indexterm"NAME="UPT-ART-1015-IX-BACKGROUND-PROCESSES"></A>Instead of waiting until theprogram finishes, UNIX lets you give another command immediately. Itthen runs both programs at the same time, along with the otherprograms that are running. You are time sharing with yourself.</P><PCLASS="para">Running a job in the background is a good way to take advantage of thetime the system spends running long jobs. For example, assume thatyou have just gotten a huge C program from a friend and want to<SPANCLASS="link">compile and run it (<ACLASS="linkend"HREF="ch52_08.htm"TITLE="Building Programs from Source Code ">52.8</A>)</SPAN>.But you don't want to sit while you're waiting forthe compiler to do its work; you'd liketo write a letter to yourfriend. So you can start the compilation in the background and startyour editing session in the foreground.</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>cc -O bigprogram.c &</B></CODE>[1] 2236% <CODECLASS="userinput"><B>vi letter.txt</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">The <CODECLASS="literal">&</CODE> means "run the job in the background."The next line is information the shell prints out to make iteasier for you to work with your background processes.<CODECLASS="literal">[1]</CODE> is a job number, which you'll only see on shells with<SPANCLASS="link">job control (<ACLASS="linkend"HREF="ch12_01.htm#UPT-ART-0439"TITLE="Job Control: Work Faster, Stop Runaway Jobs ">12.1</A>)</SPAN>.The <CODECLASS="literal">2236</CODE> is a<SPANCLASS="link">process ID (<ACLASS="linkend"HREF="ch38_03.htm"TITLE="Managing Processes: Overall Concepts ">38.3</A>)</SPAN>.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">ML</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 1.25 Access to Directories "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_27.htm"TITLE="1.27 How Background Processing Works "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.27 How Background Processing Works "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">1.25 Access to Directories </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">1.27 How Background Processing Works </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed & awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -