Unit 7 vi Editor Basics and Printing
1,Starting vi
2,Three Modes of vi
3,Cursor Movemnet
4,Entering insert Mode
5,Leaving insert Mode:<ESC>
6,Change,Delete,and Yank(copy):command mode
7,Put(paste):command mode
8,Undoing Changes:command mode
9,Searching for text:command mode
10,command-mode tricks
11,svageing and quiting:ex mode
12,Printing in Linux
13,Printing Commands
14,Printing Utilities
1,Starting vi
vi filename
2,Three Modes of vi
command mode:cursor movement,change,delete,copy,paste,search
insert mode

进入a,i退出ESC)type
extended mode(

quit,save,search and replace
3,Cursor Movemnet
h->left,j->down,k->up,l->right 左下上右
w->word ahead,b->word back
(->sentence back,)->sentence forward
{->paragraph above,}->paragraph below
4,Entering insert Mode
a(光标停在后一格),i(光标停在原地)
A(光标停在行尾),I(光标停在行首)
o(光标停在新增的下一空白行),O(光标停在新增的上一空白行)
5,Leaving insert Mode:<ESC>
ESC可以多次按
6,Change,Delete,and Yank(copy):command mode
cut delete yank(copy)
line cc dd yy
letter cl dl yl
word cw dw yw
7,Put(paste):command mode
p,P changed,deleted or copied date
For line oriented data:
p puts the data below the current lne
P puts the data above the current lne
For character oriented date:
p puts the data after the cursor
Pputs the data before the cursor
8,Undoing Changes:command mode
u undo most recent change
Ctrl-r redo last "undone" change
U undo all changes
9,Searching for text:command mode
/text search downwards for "text"
?text search upwards for "text"
n continue search in the same direction
N continue search in the opposite direction
10,command-mode tricks
dtc delete from cursor to the letter c
rc replace a character with c
x delete a character
5dd delete 5 lines
5yy copied 5 lines
5x delete 5 characters
R replace character-for-character until <ESC>
11,svageing and quiting:ex mode
w saving
q quitting
! forcing
root可以强写只读文件
12,Printing in Linux
CUPS
local printer
network printer
documnets->queue->input filter->printer
13,Printing Commands
BSD System V
lpr/lpq/lprm lp/lpstat/cancel
lpr filename
lpr -Php README hp是打印机名称
queue->/var/spool/cups
搬移打印工作从一个队列到另一个队列 lpmove
lpmove ok-9 hp 名字 队列
插队lp -i17 -q51
i代表job编号 q51设置优先权(默认都是50)
disable ok 让打印机停用再开启/usr/bin/enable ok (必须指明路径)(第二道门)
reject ok关闭第一道门 accept ok
14,Printing Utilities
enscript convert 文件 -p 新文件名
ggv postscript and pdf 查看
ps2pdf/pdf2ps ps2pdf readme.ps > rs.pdf
mpage print multipages per sheet
mpage -4 r.ps > m.ps 4页合成1页