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

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

?? unx07.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx07.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unx08.htm">

<LINK REL="Previous" HREF="unx06.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx06.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="unx08.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><UL>

<LI>

<A HREF="#I1">7 &#151; Text Editing with vi, EMACS, and sed</A></LI>

<UL>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I2">By Dave Taylor</A></LI></UL></UL>

<LI>

<A HREF="#I3">The vi Editor</A></LI>

<UL>

<LI>

<A HREF="#I5">How to Start and Quit vi</A></LI>

<LI>

<A HREF="#I6">Simple Character Motion in vi</A></LI>

<LI>

<A HREF="#I7">Moving by Words and Pages</A></LI>

<LI>

<A HREF="#I8">Inserting Text into the File with i, a, o, and O</A></LI>

<LI>

<A HREF="#I9">Deleting Text</A></LI>

<LI>

<A HREF="#I10">Searching within a File</A></LI>

<LI>

<A HREF="#I11">How to Start vi Correctly</A></LI>

<LI>

<A HREF="#I12">The Key Colon Commands in vi</A></LI>

<LI>

<A HREF="#I13">Advanced vi Tricks, Tools, and Techniques</A></LI>

<LI>

<A HREF="#I14">The Change and Replace Commands</A></LI>

<LI>

<A HREF="#I15">Numeric Repeat Prefixes</A></LI>

<LI>

<A HREF="#I16">Numbering Lines in the File</A></LI>

<LI>

<A HREF="#I17">Search and Replace</A></LI>

<LI>

<A HREF="#I18">Key Mapping with the map Command</A></LI>

<LI>

<A HREF="#I19">Moving Sentences and Paragraphs</A></LI>

<LI>

<A HREF="#I20">Access UNIX with !</A></LI></UL>

<LI>

<A HREF="#I21">The EMACS Editor</A></LI>

<UL>

<LI>

<A HREF="#I22">Launching EMACS and Inserting Text</A></LI>

<LI>

<A HREF="#I23">How to Move Around in a File</A></LI>

<LI>

<A HREF="#I24">How to Delete Characters and Words</A></LI>

<LI>

<A HREF="#I25">Search and Replace in EMACS</A></LI>

<LI>

<A HREF="#I26">Using the EMACS Tutorial and Help System</A></LI>

<LI>

<A HREF="#I27">Working with Other Files</A></LI></UL>

<LI>

<A HREF="#I28">The sed Command</A></LI>

<UL>

<LI>

<A HREF="#I29">Changing Things En Route with sed</A></LI></UL></UL></UL></UL>



<H1 ALIGN="CENTER">

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

<BR>

<FONT SIZE=5><B>7 &#151; Text Editing with </B><B>vi</B><B>, EMACS, and </B><B>sed</B>

<BR></FONT></A></CENTER></H1>

<H5 ALIGN="CENTER">

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

<FONT SIZE=3><B>By Dave Taylor</B>

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

<H3 ALIGN="CENTER">

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

<FONT SIZE=4><A ID="I4" NAME="I4"></A><B>The </B><B>vi</B><B> Editor</B>

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

<P>If you like primitive tools, you've already figured out that you can use a combination of &lt;&lt; and cat to add lines to a file, and you can use sed and file redirection to modify the contents of a file. These tools are rough and awkward, and when 
it's time to either create new files or modify existing ones, you need a screen-oriented editor. In UNIX, the screen editor of choice is called vi.

<BR></P>

<P>There are a number of editors that may be included with your UNIX system, including ed, ex, vi, and EMACS. The latter two use the entire screen, a big advantage, and both are powerful editors. This section focuses on vi, however, because it's easier 
and, perhaps more importantly, it's guaranteed to always be part of UNIX. Most vendors omit EMACS, forcing you to find it yourself.

<BR></P>

<P>In this section, you will learn how to start and quit vi, simple character motion in vi, how to move by words and pages, how to insert text into the file, how to search within a file, how to have vi start out right, the key colon commands in vi.

<BR></P>

<P>In some ways, an editor is like another operating system living within UNIX. If you're used to Windows or Macintosh editors, you'll be unhappy to find that vi doesn't know anything about your mouse. Once you spend some time working with vi, however, it 

will grow on you. By the end of this section, you will be able to create and modify files on your UNIX system to your heart's content.

<BR></P>

<H4 ALIGN="CENTER">

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

<FONT SIZE=3><B>How to Start and Quit </B><B>vi</B>

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

<P>Most UNIX commands do their work, display their results, and quit. Among the few exceptions are more and pg, where you work within the specific program environment until you have viewed the entire contents of the file being shown, or until you quit. The 

vi editor is another program in this small category of environments, programs that you move in and use until you explicitly tell the program to quit.

<BR></P>

<P>Before you start vi for the first time, you must learn about two aspects of its behavior. The first is that vi is a modal editor. A mode is like an environment. Different modes in vi interpret the same key differently. For example, if you're in insert 
mode, pressing the A key adds an a to the text, whereas in command mode, pressing the A key enters a, a single key abbreviation for the append command. If you ever get confused about what mode you're in, press the Esc key on your keyboard. Pressing Esc 
always returns you to the command mode (and if you're already in command mode, it beeps to remind you of that fact).

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> In vi, the Enter key is a specific command (meaning move to the beginning of the next line). As a result, you never need to press Enter to have vi process your command.

<BR></NOTE>

<HR ALIGN=CENTER>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> EMACS is a modeless editor. In EMACS, the A key always adds the letter a to the file. Commands in EMACS are all indicated by holding down the Ctrl key while pressing the command key; for example, 
Ctrl+C deletes a character.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>The second important characteristic of vi is that it's a screen-oriented program. It must know what kind of terminal, computer, or system you're using to work with UNIX. This probably won't be a problem for you, because most systems are set up so that 
the default terminal type matches the terminal or communications program you're using. Here you will learn how to recognize when vi cannot figure out what terminal you're using, and what to do about it.

<BR></P>

<P>You can start vi in a number of different ways, and you will learn about lots of helpful alternatives later. Right now you will learn the basics. The vi command by itself starts the editor, ready for you to create a new file. The vi command with a 
filename starts vi with the specified file, so you can modify that file immediately.

<BR></P>

<P>To begin, enter vi at the prompt. If all is working well, the screen will clear, the first character on each line will become a tilde (~), and the cursor will be sitting at the top-left corner of the screen:

<BR></P>

<PRE>% vi

_

~

~

~

~

~

~

~

~

~

~</PRE>

<P>Type a colon character. Doing so moves the cursor to the bottom of the screen and replaces the last tilde with a colon:

<BR></P>

<PRE>~

~

~

~

~

~

~

~

:_</PRE>

<P>Press the q key and the Enter key, and you should be back at the shell prompt:

<BR></P>

<PRE>~

~

~

~

~

~

~

~

:q

%</PRE>

<P>If that operation worked without a problem, go ahead and append your command to your .login or .profile file. If the operation did not work, you received the unknown-terminal-type error message. You might see this on your screen:

<BR></P>

<PRE>% vi

&quot;unknown&quot;: Unknown terminal type

I don't know what type of terminal you are on. All I have is &quot;unknown&quot;

 [using open mode]

_</PRE>

<P>Alternatively, you might see this:

<BR></P>

<PRE>% vi

Visual needs addressible cursor or upline capability

:</PRE>

<P>Don't panic. You can fix this problem. The first step is to get back to the shell prompt. To do this, do exactly what you did in the first step: type :q and press Enter. You should then see this:

<BR></P>

<PRE>% vi

&quot;unknown&quot;: Unknown terminal type

I don't know what type of terminal you are on. All I have is &quot;unknown&quot;

 [using open mode]

:q

%</PRE>

<P>The problem here is that vi needs to know the type of terminal you're using, but it can't figure that out on its own. Therefore, you need to tell this to the operating system by setting the TERM environment variable. If you know what kind of terminal 
you have, use that value; otherwise, try the default of vt100:

<BR></P>

<PRE>% setenv TERM vt100</PRE>

<P>If you have the $ prompt, which means you're using the Bourne shell (sh) or Korn shell (ksh) rather than the C shell (csh), try this:

<BR></P>

<PRE>$ TERM=vt100 ; export TERM</PRE>

<P>Either way, you can now try entering vi again, and it should work. If it does work, append the command (whichever of these two commands was successful for you) to your .login file if you use csh, or to .profile if you use sh or ksh:

<BR></P>

<PRE>% echo &quot;setenv TERM vt100&quot; &gt;&gt; .login</PRE>

<P>or

<BR></P>

<PRE>$ echo &quot;TERM=vt100 ; export TERM&quot; &gt;&gt; .profile</PRE>

<P>This way, the next time you log in, the system will remember what kind of terminal you're using.

<BR></P>

<P>If this didn't work, it's time to talk with your system administrator about the problem or to call your UNIX vendor to find out what the specific value should be. If you are connected through a modem or other line, and you are actually using a terminal 

emulator or communications package, then you might also try using ansi as a TERM setting. If that fails, call the company that makes your software and ask them what terminal type the communications program is emulating.

<BR></P>

<P>Great! You have successfully launched vi, seen what it looks like, and even entered the most important command: the quit command. Now create a simple file and start vi so it shows you the contents of the file:

<BR></P>

<PRE>% ls -l &gt; demo

% vi demo

total 29

drwx&#151;&#151;&#151; 2 taylor        512 Nov 21 10:39 Archives/

drwx&#151;&#151;&#151;  3 taylor        512 Dec  3 02:03 InfoWorld/

drwx&#151;&#151;&#151;  2 taylor       1024 Dec  3 01:43 Mail/

drwx&#151;&#151;&#151;  2 taylor        512 Oct  6 09:36 News/

drwx&#151;&#151;&#151;  4 taylor        512 Dec  2 22:08 OWL/

-rw-rw&#151;&#151;  1 taylor        126 Dec  3 16:34 awkscript

-rw-rw&#151;&#151;  1 taylor        165 Dec  3 16:42 bigfiles

drwx&#151;&#151;&#151;  2 taylor        512 Oct 13 10:45 bin/

-rw-rw&#151;&#151;  1 taylor          0 Dec  3 22:26 demo

-rw-rw&#151;&#151;  1 taylor      12556 Nov 16 09:49 keylime.pie

-rw-rw&#151;&#151;  1 taylor       8729 Dec  2 21:19 owl.c

-rw-rw&#151;&#151;  1 taylor        199 Dec  3 16:11 sample

-rw-rw&#151;&#151;  1 taylor        207 Dec  3 16:11 sample2

drwx&#151;&#151;&#151;  2 taylor        512 Oct 13 10:45 src/

drwxrwx&#151;  2 taylor        512 Nov  8 22:20 temp/

-rw-rw&#151;&#151;  1 taylor        582 Nov 27 18:29 tetme

~

~

~

~

~

~

~

&quot;demo&quot; 17 lines, 846 characters</PRE>

<P>You can see that vi reads the file specified on the command line. In this example, my file is 17 lines long, but my screen can hold 25 lines. To show that some lines lack any text, vi uses the tilde on a line by itself. Finally, note that, at the 
bottom, the program shows the name of the file, the number of lines it found in the file, and the total number of characters.

<BR></P>

<P>Type :q again to quit vi and return to the command line for now. When you type the colon, the cursor will flash down to the bottom line and wait for the q, as it did before.

<BR></P>

<P>You have learned the most basic command in vi&#151;the :q command&#151;and survived the experience. It's all downhill from here.

<BR></P>

<H4 ALIGN="CENTER">

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

<FONT SIZE=3><B>Simple Character Motion in </B><B>vi</B>

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

<P>Getting to a file isn't much good if you can't actually move around in it. Now you will learn how to use the cursor control keys in vi. To move left one character, press the h key. To move up, press the k key. To move down, press the j key. To move 
right a single character, use the l key. You can move left one character by pressing the Backspace key, and you can move to the beginning of the next line with the Enter key.

<BR></P>

<P>Launch vi again, specifying the demo file:

<BR></P>

<PRE>% vi demo

total 29

drwx&#151;&#151;&#151;  2 taylor        512 Nov 21 10:39 Archives/

drwx&#151;&#151;&#151;  3 taylor        512 Dec  3 02:03 InfoWorld/

drwx&#151;&#151;&#151;  2 taylor       1024 Dec  3 01:43 Mail/

drwx&#151;&#151;&#151;  2 taylor        512 Oct  6 09:36 News/

drwx&#151;&#151;&#151;  4 taylor        512 Dec  2 22:08 OWL/

-rw-rw&#151;&#151;  1 taylor        126 Dec  3 16:34 awkscript

-rw-rw&#151;&#151;  1 taylor        165 Dec  3 16:42 bigfiles

drwx&#151;&#151;&#151;  2 taylor        512 Oct 13 10:45 bin/

-rw-rw&#151;&#151;  1 taylor          0 Dec  3 22:26 demo

-rw-rw&#151;&#151;  1 taylor      12556 Nov 16 09:49 keylime.pie

-rw-rw&#151;&#151;  1 taylor       8729 Dec  2 21:19 owl.c

-rw-rw&#151;&#151;  1 taylor        199 Dec  3 16:11 sample

-rw-rw&#151;&#151;  1 taylor        207 Dec  3 16:11 sample2

drwx&#151;&#151;&#151;  2 taylor        512 Oct 13 10:45 src/

drwxrwx&#151;  2 taylor        512 Nov  8 22:20 temp/

-rw-rw&#151;&#151;  1 taylor        582 Nov 27 18:29 tetme

~

~

~

~

~

~

~

&quot;demo&quot; 17 lines, 846 characters</PRE>

<P>You should see the cursor sitting on top the t in total on the first line, or perhaps flashing underneath the t character. Perhaps you have a flashing box cursor or one that shows up in a different color. In any case, that's your starting spot in the 
file.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷av一区二区三区软件| 亚洲国产岛国毛片在线| 欧美一级理论片| 26uuu欧美| 中文字幕综合网| 午夜精品成人在线视频| 欧美aa在线视频| 粉嫩av亚洲一区二区图片| 色94色欧美sute亚洲线路一ni | 久久久久久久久久看片| ...xxx性欧美| 日韩电影在线观看网站| 丁香一区二区三区| 欧美日韩情趣电影| 日本一区二区三区dvd视频在线| 亚洲精品免费在线| 激情伊人五月天久久综合| 成人国产亚洲欧美成人综合网| 色诱视频网站一区| 欧美精品一区二区三区蜜桃视频| 国产精品久久久久久久久免费樱桃| 亚洲大片免费看| 国产剧情一区在线| 欧美色综合网站| 国产女人18水真多18精品一级做| 亚洲电影在线免费观看| 成人午夜av电影| 51精品秘密在线观看| 国产精品大尺度| 美国欧美日韩国产在线播放| 一本色道综合亚洲| 久久久.com| 天堂av在线一区| 91伊人久久大香线蕉| 久久久久综合网| 视频一区欧美日韩| 色噜噜狠狠成人中文综合 | 国产a久久麻豆| 91精品国产乱码久久蜜臀| 亚洲婷婷综合色高清在线| 国产最新精品精品你懂的| 欧美男人的天堂一二区| 亚洲视频资源在线| 国产成人免费在线视频| 欧美大白屁股肥臀xxxxxx| 亚洲一区二区三区四区五区黄| 丰满亚洲少妇av| 久久综合网色—综合色88| 天天做天天摸天天爽国产一区| 97se亚洲国产综合自在线观| 久久久综合九色合综国产精品| 婷婷久久综合九色综合绿巨人| 色网综合在线观看| 国产精品久久久久影院亚瑟 | 久久久久99精品一区| 日韩av网站免费在线| 欧洲人成人精品| 亚洲日本免费电影| 99国产精品国产精品久久| 国产欧美日韩综合| 国产精品一级黄| 久久综合久久综合久久综合| 久久99精品网久久| 日韩精品专区在线影院观看 | 日韩免费视频一区二区| 日韩专区在线视频| 欧美日韩亚洲综合| 亚洲va天堂va国产va久| 欧美在线观看视频一区二区三区 | 欧美丰满嫩嫩电影| 三级欧美韩日大片在线看| 欧美视频精品在线观看| 亚洲第一久久影院| 4438x亚洲最大成人网| 亚洲v精品v日韩v欧美v专区| 欧美裸体一区二区三区| 丝袜美腿亚洲色图| 欧美一级一级性生活免费录像| 日韩av不卡在线观看| 欧美肥妇毛茸茸| 蜜臀av国产精品久久久久| 日韩精品中文字幕在线一区| 另类中文字幕网| 精品久久久久久久久久久久包黑料 | 国模套图日韩精品一区二区| 精品国产麻豆免费人成网站| 激情图片小说一区| 国产香蕉久久精品综合网| 国产福利精品一区二区| 中文字幕不卡在线观看| 99国产一区二区三精品乱码| 亚洲精品国产视频| 欧美人妇做爰xxxⅹ性高电影| 婷婷亚洲久悠悠色悠在线播放| 欧美一区二区三区影视| 蜜臀av一区二区在线免费观看| 日韩欧美成人一区二区| 国产精品99久久久久| 国产精品久久久久久久久快鸭| 91美女福利视频| 天天综合网 天天综合色| 日韩精品一区二区三区中文不卡 | 日韩一区二区免费高清| 国产原创一区二区| 国产精品福利一区| 欧美人妇做爰xxxⅹ性高电影| 久久不见久久见免费视频1| 国产午夜精品福利| 欧美综合色免费| 精品一区二区在线看| 中文乱码免费一区二区| 在线看不卡av| 国产制服丝袜一区| 亚洲美女淫视频| 欧美不卡在线视频| 99久久久久久99| 三级不卡在线观看| 国产精品久久看| 欧美日韩成人一区二区| 国产麻豆精品在线观看| 亚洲黄网站在线观看| 欧美va亚洲va| 色国产综合视频| 久久9热精品视频| 亚洲婷婷综合久久一本伊一区| 欧美一区中文字幕| av高清不卡在线| 麻豆成人91精品二区三区| 中文字幕亚洲区| 欧美videos中文字幕| 色综合一区二区| 国产一区二区三区国产| 玉足女爽爽91| 国产亚洲1区2区3区| 欧美久久久久久久久中文字幕| 国产 日韩 欧美大片| 五月天久久比比资源色| 国产精品免费视频一区| 欧美电影影音先锋| 91视视频在线观看入口直接观看www | 一本色道a无线码一区v| 国产一区视频网站| 天天亚洲美女在线视频| 中文字幕一区三区| www国产精品av| 91.麻豆视频| 日本韩国欧美三级| 国产suv精品一区二区6| 玖玖九九国产精品| 婷婷亚洲久悠悠色悠在线播放| 亚洲欧洲日韩一区二区三区| 久久亚区不卡日本| 91精品国产综合久久精品app| 91色porny| 成人动漫一区二区| 国产专区综合网| 久久国产综合精品| 午夜精品视频在线观看| 亚洲精品日韩专区silk| 亚洲国产成人自拍| 国产日韩欧美a| 欧美精品一区二区三区蜜臀| 91精品视频网| 欧美三级视频在线观看| 色偷偷久久人人79超碰人人澡| 国产ts人妖一区二区| 国产成人免费在线视频| 国产精品亚洲一区二区三区妖精 | 欧美精品高清视频| 欧美揉bbbbb揉bbbbb| 色婷婷综合久色| 99久久精品情趣| 波多野结衣的一区二区三区| 国产二区国产一区在线观看| 久88久久88久久久| 久久精品国产精品青草| 另类的小说在线视频另类成人小视频在线 | 成人激情视频网站| 国产精品香蕉一区二区三区| 久久99九九99精品| 国内精品自线一区二区三区视频| 麻豆91在线看| 九色porny丨国产精品| 久久精品国产免费| 国产一区二区主播在线| 国产毛片精品一区| 国产精品羞羞答答xxdd| 成人国产精品免费网站| a在线欧美一区| bt7086福利一区国产| 色先锋aa成人| 欧美伦理电影网| 欧美不卡123| 久久免费电影网| 欧美激情一二三区| 亚洲人亚洲人成电影网站色| 亚洲免费在线看| 亚洲动漫第一页| 六月丁香婷婷久久| 国产.欧美.日韩|