Linux Shell脚本教程(LSST)---基本的vi命令
2011-10-03 20:55
351 查看
这一部分大家都应该能看懂就不翻译了
Common vi editor command list
Common vi editor command list
For this Purpose | Use this vi Command Syntax |
To insert new text | esc + i ( You have to press 'escape' key then 'i') |
To save file | esc + : + w (Press 'escape' key then 'colon' and finally 'w') |
To save file with file name (save as) | esc + : + w "filename" |
To quit the vi editor | esc + : + q |
To quit without saving | esc + : + q! |
To save and quit vi editor | esc + : + wq |
To search for specified word in forward direction | esc + /word (Press 'escape' key, type /word-to-find, for e.g. to find word 'shri', type as /shri) |
To continue with search | n |
To search for specified word in backward direction | esc + ?word (Press 'escape' key, type word-to-find) |
To copy the line where cursor is located | esc + yy |
To paste the text just deleted or copied at the cursor | esc + p |
To delete entire line where cursor is located | esc + dd |
To delete word from cursor position | esc + dw |
To Find all occurrence of given word and Replace then globally without confirmation | esc + :$s/word-to-find/word-to-replace/g For. e.g. :$s/mumbai/pune/g Here word "mumbai" is replace with "pune" |
To Find all occurrence of given word and Replace then globally with confirmation | esc + :$s/word-to-find/word-to-replace/cg |
To run shell command like ls, cp or date etc within vi | esc + :!shell-command For e.g. :!pwd |
相关文章推荐
- Linux Shell脚本教程(LSST)---Linux是什么
- Linux Shell脚本教程(LSST) 一
- Linux Shell脚本系列教程(四):使用函数添加环境变量
- linux shell 脚本30分钟教程
- linux shell脚本编程基本语法
- 结合PHP脚本添加和查询MySQL数据的基本教程
- Linux Shell脚本系列教程(三):变量和环境变量
- Linux Shell脚本教程
- Linux Shell脚本系列教程(二):终端打印命令详解
- Linux Shell脚本教程:30分钟玩转Shell脚本编程
- Linux shell 脚本入门教程+实例
- 学习笔记之Linux Shell脚本教程:30分钟玩转Shell脚本编程
- Linux Shell脚本系列教程(一):Shell入门
- 结合PHP脚本添加和查询MySQL数据的基本教程
- Linux Shell系列教程之(二)第一个Shell脚本
- ◎Vbs脚本编程简明教程之八—FSO中文件夹的基本操作
- Linux Shell系列教程之(二)第一个Shell脚本
- Linux Shell 脚本编程入门教程
- Linux Shell脚本系列教程(一):Shell入门
- ◎Vbs脚本编程简明教程之十一 ――FSO中文件的基本操作