亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unx18.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
difficult (for example, while loops) or because internal implementation is a big performance win (for example, echo in some shells). One reason the built-in commands are easier is that they can operate directly in the shell process rather than forcing the 

shell to create a new process to run a different command. That new command would not have access to the shell's memory.

<BR></P>

<H5 ALIGN="CENTER">

<CENTER><A ID="I11" NAME="I11">

<FONT SIZE=3><B>Make a New Process with </B><B><I>fork</I></B>

<BR></FONT></A></CENTER></H5>

<P>If the command you typed is not a built-in command (for example, if you entered ps), the shell performs a fork to create a new process. Your UNIX system allocates the necessary resources. The shell modifies the process environment to configure correctly 

for the command to be executed. This includes any input or output redirect you may have requested (including command pipelines) and creating a new background process group if you executed the command in the background.

<BR></P>

<H5 ALIGN="CENTER">

<CENTER><A ID="I12" NAME="I12">

<FONT SIZE=3><B>Start a New Command with </B><B><I>exec</I></B>

<BR></FONT></A></CENTER></H5>

<P>Finally, the shell performs an exec to execute the program that you requested. The program will replace the shell with a forked shell, but your shell will still be running.

<BR></P>

<H5 ALIGN="CENTER">

<CENTER><A ID="I13" NAME="I13">

<FONT SIZE=3><B>An Example</B>

<BR></FONT></A></CENTER></H5>

<P>The following happens when you enter ps -f &gt; t1 followed by cat t1:

<BR></P>

<PRE>$ ps -f &gt; t1

$ cat t1

     UID   PID  PPID  C    STIME TTY      TIME COMMAND

    root 14931   136  0 08:37:48 ttys0    0:00 rlogind

  sartin 14932 14931  0 08:37:50 ttys0    0:00 -sh

  sartin 15339 14932  7 16:32:29 ttys0    0:00 ps -f

$</PRE>

<P>UNIX performs the following steps to execute ps -f&gt; t1:

<BR></P>

<OL>

<LI><B>Shell command processing.</B> The login shell (PID 14932 in this example) performs variable substitution and examines the command line to determine that ps is not a built-in or an alias.

<BR>

<BR></LI>

<LI><B>fork/wait.</B> The login shell (PID 14932) forks a new process (PID 15339). This new process is an exact copy of the login shell. It has the same open files, the same user ID, and a copy of the memory, and it is executing the same code. Because the 

command was not executed in the background, the login shell (14932) will execute a wait to wait for the new child (15339) to complete.

<BR>

<BR></LI>

<LI><B>setup.</B> The new shell (PID 15339) performs the operations it needs to do in order to prepare for the new program. In this case, it redirects the standard output to a file (if it existed) in the current directory named t1, overwriting the file.

<BR>

<BR></LI>

<LI><B>exec.</B> The new shell (PID 15339) asks the UNIX system to exec the ps command with -f as its argument. UNIX throws away the memory from the shell and loads the ps command code and data into the process memory. The ps command will run and write its 

output to the standard output, which has been redirected to the file t1.

<BR>

<BR></LI>

<LI><B>wait ends.</B> When the ps command is done executing, the login shell (PID 14932) receives notification and will prompt the user for more input.

<BR>

<BR></LI></OL>

<H4 ALIGN="CENTER">

<CENTER><A ID="I14" NAME="I14">

<FONT SIZE=3><B>Executing in the Background</B>

<BR></FONT></A></CENTER></H4>

<P>You can tell your shell to execute commands in the background, which tells the shell not to wait for the command to complete. This enables you to run programs without having to wait for them to complete.

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> For long-running commands that are not interactive, you can run the command in the background and continue to do work while it executes. Use the nohup command to make sure the process will not get 
interrupted; nohup will redirect the command output to a file called nohup.out. For example, to run a make in the background enter nohup make all. When the make terminates, you can read nohup.out to check the output.

<BR></NOTE>

<HR ALIGN=CENTER>

<H5 ALIGN="CENTER">

<CENTER><A ID="I15" NAME="I15">

<FONT SIZE=3><B>An Example</B>

<BR></FONT></A></CENTER></H5>

<P>This example is almost the same as the previous example. The only difference is that the ps command is executed in the background. The following happens when you are using the Bourne shell and enter ps -f &gt; t1 &amp; followed by cat t1:

<BR></P>

<PRE>$ ps -f &gt; t1 &amp;

15445

$ cat t1

     UID   PID  PPID  C    STIME TTY      TIME COMMAND

    root 14931   136  1 08:37:48 ttys0    0:00 rlogind

  sartin 14932 14931  0 08:37:50 ttys0    0:00 -sh

  sartin 15445 14932  8 17:31:14 ttys0    0:00 ps -f

$</PRE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="warning.gif" WIDTH = 37 HEIGHT = 35><B>WARNING:</B> Do not depend on the output of a background process until you know the process has completed. If the command is still running when you examine the output, you may see incomplete output.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>UNIX performs the following steps to execute ps -f &gt; t1 &amp;:

<BR></P>

<OL>

<LI><B>Shell command processing.</B> The login shell (PID 14932 in this example) performs variable substitution and examines the command line to determine that ps is not a built-in or an alias.

<BR>

<BR></LI>

<LI><B>fork.</B> The login shell (PID 14932) forks a new process (PID 15445). This new process is an exact copy of the login shell. It has the same open files, the same user ID, and a copy of the memory, and it is executing the same code. Because the 
command was executed in the background, the login shell (14932) will immediately prompt you for input. Because your background command may still be running, you should not depend on its output until you know the process completed. You will be able to run a 

new command immediately.

<BR>

<BR></LI>

<LI><B>setup.</B> The new shell (PID 15445) performs the operations it needs to do in order to prepare for the new program. In this case, it redirects the standard output to a file in the current directory named t1, overwriting the file (if it existed).

<BR>

<BR></LI>

<LI><B>exec.</B> The new shell (PID 15445) asks the UNIX system to exec the ps command with -f as its argument. UNIX throws away the memory from the shell and loads the ps command code and data into the process memory. The ps command will run and write its 

output to the standard output, which has been redirected to the file t1.

<BR>

<BR></LI></OL>

<H3 ALIGN="CENTER">

<CENTER><A ID="I16" NAME="I16">

<FONT SIZE=4><B>Kinks in Your Pipeline</B>

<BR></FONT></A></CENTER></H3>

<P>One of the things the fork/exec model enables is creating command pipelines, a series of commands with the output of one command as the input for the next. This powerful notion is one of the major advantages of UNIX over some other systems. See Chapter 

1, &quot;Operating Systems.&quot;

<BR></P>

<P>Creating a pipeline is similar to creating an ordinary command. The difference is in how output is redirected. In the ordinary case, the shell performs some simple I/O redirection before executing the program. In the pipeline case, the shell will 
instead connect the standard output of one command as the standard input of another.

<BR></P>

<P>If you enter ps -f | grep sartin you might get output such as the following:

<BR></P>

<PRE>$ ps -f | grep sartin

  sartin 14932 14931  1 08:37:50 ttys0    0:00 -sh

  sartin 15424 14932  1 17:15:02 ttys0    0:00 grep sartin

  sartin 15425 15424  7 17:15:02 ttys0    0:00 ps -f

$</PRE>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> Some shells perform these tasks in slightly different orders. This example illustrates what one version of the Bourne shell does. Variations are relatively minor and involve the details of which 
process does the extra fork calls.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>In order to get this output, the shell went through the following series of steps:

<BR></P>

<OL>

<LI><B>fork (1).</B> The login shell (PID 14932) forks a new process (15424) to execute the pipeline. This subprocess (15424) redirects input, or creates a pipe, so that standard input is  from a pipe. The login shell (14932) then waits for the pipeline 
execution to complete.

<BR>

<BR></LI>

<LI><B>fork (2).</B> The shell subprocess (15424) forks another new process (15425) to help execute the pipeline. This new subprocess (15425) connects its standard output to the pipe that its parent (15424) is using for input.

<BR>

<BR></LI>

<LI><B>exec (1).</B> The first subprocess (15424) executes the grep program.

<BR>

<BR></LI>

<LI><B>exec (2).</B> The second subprocess (15425) executes the ps program.

<BR>

<BR></LI></OL>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>Avoiding the Background with GUI</B>

<BR>

<BR>With the advent of graphical user interfaces (GUIs) on UNIX, you do not need to use background processes to be able to run multiple programs at once. Instead, you can run each command either from a graphical interface or from its own terminal window. 
This can be very resource intensive, so don't try to do too many things at once.

<BR></NOTE>

<HR ALIGN=CENTER>

<H3 ALIGN="CENTER">

<CENTER><A ID="I17" NAME="I17">

<FONT SIZE=4><B>A Special Process Called Daemon</B>

<BR></FONT></A></CENTER></H3>

<P>As you learned in Chapter 1, many of the features that are sometimes implemented as part of the kernel, the core of the operating system, are not in the UNIX kernel. Instead, many of these features are implemented using special processes called daemons. 

A daemon is a process that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. Many system functions are commonly performed by daemons, including the sendmail daemon, which handles mail, 

and the NNTP daemon, which handles USENET news. Many other daemons may exist on your system; check the documentation for more information.

<BR></P>

<P>Generally only system administrators need to know about most daemons, but there are three daemons that are important and widespread enough that you should probably have a minimal understanding of what they do; they are init, inetd, and cron.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I18" NAME="I18">

<FONT SIZE=3><B><I>init</I></B>

<BR></FONT></A></CENTER></H4>

<P>In a way the init program is the &quot;super daemon.&quot; It takes over the basic running of the system when the kernel has finished the boot process. It is responsible for the following:

<BR></P>

<UL>

<LI><B>Running scripts that change state.</B> Every time the system administrator switches the system to a new state, init runs any programs needed to update the system to the new state.

<BR>

<BR></LI>

<LI><B>Managing terminals.</B> Each physical terminal is monitored by a program called getty; it is the job of init to keep getty properly running and shut it down when the system administrator disables logins. On systems with GUI consoles, init may be 
responsible for keeping the graphical login program running.

<BR>

<BR></LI>

<LI>Reaping<B> processes.</B> When a process terminates, UNIX keeps some status information around until the parent process reads that information. Sometimes the parent process terminates before the child. Sometimes the parent process terminates without 
reading the status of the child. Any time either of these happens, UNIX makes init the parent process of the resulting zombie process, and init must read the process status so that UNIX can reuse the process slot. Sometimes, init isn't able to do the job 
of releasing zombies, too. However, this is unusual in most of the recent UNIX-based systems.

<BR>

<BR></LI></UL>

<P>For further information on init, see Chapter 34, &quot;Starting Up and Shutting Down.&quot;

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I19" NAME="I19">

<FONT SIZE=3><B><I>inetd</I></B>

<BR></FONT></A></CENTER></H4>

<P>A second powerful daemon is the inetd program common to many UNIX machines (including those based on BSD and many that are based on System V). The inetd process is the network &quot;super server&quot; daemon. It is responsible for starting network 
services that do not have their own stand-alone daemons. For example, inetd usually takes care of incoming rlogin, telnet, and ftp connections. (See Chapter 9, &quot;Getting Around the Network.&quot;)

<BR></P>

<P>For further information on inetd, see Chapter 37, &quot;Networking.&quot;

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I20" NAME="I20">

<FONT SIZE=3><B><I>cron</I></B>

<BR></FONT></A></CENTER></H4>

<P>Another common daemon is the cron program, which is responsible for running repetitive tasks on a regular schedule. It is a perfect tool for running system administration tasks such as backup and system logfile maintenance. It can also be useful for 
ordinary users to schedule regular tasks including calendar reminders and report generation. For more information, see Chapter 20, &quot;Scheduling Processes.&quot;

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I21" NAME="I21">

<FONT SIZE=4><B>Summary</B>

<BR></FONT></A></CENTER></H3>

<P>In this chapter you have learned what a UNIX process is, how your interaction with UNIX starts and stops processes, and a little bit about a few special processes called daemons. A process is an entire execution environment for your computer program; it 

is almost like having a separate computer that executes your program. UNIX switches quickly between processes to give the illusion that they are all running simultaneously. You start a process any time you run a command or pipeline in the shell. You can 
even start a process in the background and perform other tasks while it is executing. Several processes called daemons run on your system to perform special tasks and supply services that some operating systems supply in the kernel.</P>

<P><A HREF="unxpt4au.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unx19.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P></BODY></HTML>









?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频在线看| 国产精品美女久久久久aⅴ | 日韩女优制服丝袜电影| 欧美一区二区三区视频免费播放| 欧美日韩不卡一区二区| 久久综合色播五月| 国产日韩欧美制服另类| 亚洲男人天堂一区| 蜜臀精品久久久久久蜜臀| 国产精品中文欧美| 欧美视频在线播放| 国产欧美一二三区| 天天综合天天综合色| 菠萝蜜视频在线观看一区| 日韩欧美亚洲一区二区| 亚洲视频在线观看一区| 国内精品久久久久影院薰衣草| 91麻豆精品秘密| 国产欧美1区2区3区| 蜜臀精品久久久久久蜜臀| 91天堂素人约啪| 国产日本欧美一区二区| 美腿丝袜亚洲三区| 欧美日韩中文字幕精品| 中文字幕一区二区三中文字幕| 人人狠狠综合久久亚洲| 欧美久久高跟鞋激| 亚洲成人自拍网| 欧美日本韩国一区二区三区视频| 亚洲精品大片www| 国产成人精品亚洲日本在线桃色 | 亚洲福利一二三区| 91看片淫黄大片一级在线观看| 久久久亚洲午夜电影| 国产成人免费在线观看| 欧美tickling挠脚心丨vk| 日韩高清一区二区| 精品国一区二区三区| 狠狠色丁香婷婷综合久久片| 精品国产网站在线观看| 国产一区亚洲一区| 国产精品午夜在线观看| 99riav一区二区三区| 亚洲自拍欧美精品| 欧美不卡一区二区| 不卡一二三区首页| 天天综合网天天综合色| 欧美精品一区二区三区高清aⅴ| 国产成人精品免费网站| 一区二区三区小说| 国产日韩精品一区二区三区在线| 高清视频一区二区| 午夜精品一区在线观看| 久久综合给合久久狠狠狠97色69| 粉嫩一区二区三区性色av| 亚洲亚洲精品在线观看| 精品国产区一区| 日本电影亚洲天堂一区| 久久成人av少妇免费| 国产一区二区三区在线观看免费| 欧美国产97人人爽人人喊| 欧美日韩不卡一区二区| 91免费看`日韩一区二区| 麻豆视频一区二区| 青草国产精品久久久久久| 亚洲黄色性网站| 欧美国产激情一区二区三区蜜月 | 亚洲精品日日夜夜| 一区二区三区欧美久久| 国产情人综合久久777777| 高清在线成人网| 激情综合网天天干| 麻豆成人综合网| 免费不卡在线视频| 日韩不卡免费视频| 亚洲午夜在线视频| 亚洲国产日日夜夜| 亚洲自拍另类综合| 日日夜夜精品免费视频| 日本欧美加勒比视频| 石原莉奈一区二区三区在线观看| 粉嫩欧美一区二区三区高清影视 | 91亚洲永久精品| 色悠悠久久综合| 在线免费观看日本欧美| 欧美最猛性xxxxx直播| 欧美图片一区二区三区| 欧亚一区二区三区| 日韩亚洲欧美在线| 欧美精彩视频一区二区三区| 日本一区二区免费在线 | 欧美午夜在线观看| 欧美电影免费观看高清完整版在线 | 视频一区欧美精品| 精品一区二区在线免费观看| 国产成人精品三级| 欧美亚洲国产bt| 久久久久久久久久久99999| 欧美国产成人精品| 奇米精品一区二区三区在线观看一 | 播五月开心婷婷综合| 欧美嫩在线观看| 欧美国产成人在线| 另类欧美日韩国产在线| 91社区在线播放| 日本一区二区三区dvd视频在线| 亚洲影视资源网| 国产美女视频一区| 日韩一级成人av| 亚洲影视资源网| 91首页免费视频| 中文字幕av在线一区二区三区| 亚洲成a人v欧美综合天堂下载| 国产麻豆视频精品| 欧美一卡2卡3卡4卡| 亚洲男人的天堂在线观看| 国产精品一二三在| 精品国产髙清在线看国产毛片| 一区av在线播放| 色婷婷久久久综合中文字幕| 欧美激情综合五月色丁香小说| 奇米在线7777在线精品 | 蜜桃av一区二区三区电影| 欧美日韩亚洲综合一区二区三区| 亚洲视频网在线直播| 99九九99九九九视频精品| 国产欧美日韩激情| 成人av网站免费观看| 亚洲欧美色图小说| 欧美性淫爽ww久久久久无| 亚洲国产成人av好男人在线观看| 91精品91久久久中77777| 午夜欧美一区二区三区在线播放| 欧美天堂一区二区三区| 美女一区二区视频| 国产亚洲污的网站| 99视频热这里只有精品免费| 亚洲人妖av一区二区| 欧美在线观看18| 久久精品国产99| 中文字幕一区av| 欧美日韩一区二区在线观看| 日韩 欧美一区二区三区| 久久久久久久精| 成人av在线影院| 日本中文字幕一区二区有限公司| 精品久久久久久久久久久院品网 | 亚洲美女区一区| 久久久久久久电影| 精品视频资源站| 成人动漫一区二区三区| 美腿丝袜在线亚洲一区| 亚洲乱码一区二区三区在线观看| 欧美一区二区成人6969| 一本大道久久a久久精品综合| 青青国产91久久久久久| 亚洲欧美区自拍先锋| 国产午夜精品福利| 日韩一级片网址| 欧美情侣在线播放| 精品视频123区在线观看| 91香蕉视频在线| 91在线高清观看| 成人爱爱电影网址| 成人黄色小视频| 91在线视频在线| 色婷婷亚洲精品| 91福利社在线观看| 欧美日韩视频在线观看一区二区三区 | 欧美自拍偷拍一区| 91一区二区在线| 欧美在线看片a免费观看| 99国产精品久久久久久久久久久| 国产99精品在线观看| 岛国精品一区二区| 成人高清视频在线观看| 色综合久久中文综合久久97| 色网站国产精品| 制服视频三区第一页精品| 精品国产乱码久久久久久影片| 亚洲精品在线电影| 国产精品女上位| 亚洲bdsm女犯bdsm网站| 国产一区二区三区黄视频| 成人av手机在线观看| 欧美性生活大片视频| 日韩一区二区三区av| 欧美韩日一区二区三区四区| 亚洲美女一区二区三区| 日本不卡一区二区三区| 国产成人免费在线| 欧美日韩国产综合草草| 国产亚洲女人久久久久毛片| 一区二区三区四区不卡在线| 国产在线精品国自产拍免费| 东方aⅴ免费观看久久av| 亚洲欧美日韩国产另类专区| 亚洲第一激情av| 99久久精品免费看国产免费软件| 日韩一区二区在线看片|