RH033读书笔记(8)-Lab 9 Using vim
Lab 9 Using vim
Sequence 1: Navigating with vim
1. Log in as user student
2. [student@stationX ~]$ cp /etc/passwd ~
3. [student@stationX ~]$ vim ~/passwd
4. First, try moving around using such as the arrows, PgUp, PgDn.
They should all work as expected. Note, however, that on older systems they might
not.
5. moving from word to word with the w and b keys.
moving by sentence (the parentheses) and paragraph (the curly braces)
6. Try combining numbers with movement keys.
5w
2Down Arrow
7. Press the i key.
The arrow keys, Home and End still move your cursor
8. Exit insert mode by pressing Esc.
9. Try pressing the u key. This will undo each change that you made. Changes can be re-done
with Ctrl-r
10. The ex mode is invoked by typing : while in command mode.
11. At the ex prompt (:) enter set nu.
12. Try entering ex mode again and typing :set nonu.
13. Try jumping to line 5 by typing 5G.
G to the end
1G to the first line
14. search feature: /root.
press n and N to navigate.
15. :set nohls.
:set hls.
16. Try running :q. :q!
Sequence 2: Configuring vim
1. [student@stationX ~]$ vim ~/.vimrc
:set nu
:set wrapmargin=10
2. [student@stationX ~]$vim /etc/passwd again.
Sequence 3: Configuring basic sudo privileges with vim
1. [student@stationX ~]$ su -
2. [root@stationX ~]# visudo
3. /root
The line appears about halfway down the file and looks like this:
root ALL=(ALL) ALL
4. yyp
yy "yanks" (copies) the current line and p "pastes" it one line down.
5. cw studen Esc.
6. w cw stationX
The line should now read:
student stationX=(ALL) ALL
7. Exit insert mode by pressing Esc. :wq
8. [student@stationX ~]$ ls /etc/pki/CA
ls: /etc/pki/CA: Permission denied
[student@stationX ~]$ sudo ls /etc/pki/CA
Password:
private
9. sudo will remember that you have already authenticated for five minutes before prompting you
again.
Challenge Sequence 4: Learning more with vimtutor
1. [student@stationX ~]$ vimtutor
RH033读书笔记(8)-Lab 9 Using vim的更多相关文章
- RH033读书笔记(15)-Lab 16 The Linux Filesystem
Lab 16 The Linux Filesystem Goal: Develop a better understanding of Linux filesystem essentials incl ...
- RH033读书笔记(10)-Lab 11 Process Control
Lab 11 Process Control Sequence 1: Job Control 1. [student@stationX ~]$ su - 2. Begin some jobs in t ...
- RH033读书笔记(2)-Lab 3 Getting Help with Commands
Lab 3 Getting Help with Commands Sequence 1: Using the Help Tools 1. man -f keyword whatis keyword l ...
- RH033读书笔记(5)-Lab 6 Exploring the Bash Shell
Lab 6 Exploring the Bash Shell Sequence 1: Directory and file organization 1. Log in as user student ...
- RH033读书笔记(4)-Lab 5 File Permissions
Lab 5 File Permissions Sequence 1: Determining File Permissions 1. What is the symbolic representati ...
- RH033读书笔记(3)-Lab 4 Browsing the Filesystem
Lab 4 Browsing the Filesystem Sequence 1: Directory and File Organization 1. Log in as user student ...
- RH033读书笔记(7)-Lab 8 Introduction to String Processing
Lab 8 Introduction to String Processing Sequence 1: Exercises in string processing 1. Other than the ...
- RH033读书笔记(6)-Lab 7 Standard I/O and Pipes
Lab 7 Standard I/O and Pipes 1. [student@stationX ~]$ cat /proc/cpuinfo /proc/meminfo 2. [student@st ...
- RH033读书笔记(11)-Lab 12 Configuring the bash Shell
Sequence 1: Configuring the bash Shell Deliverable: A system with new aliases that clear the screen, ...
随机推荐
- 从零开始学C++之动态创建对象
回顾前面的文章,实现了一个简单工厂模式来创建不同类对象,但由于c++没有类似new "Circle"之类的语法,导致CreateShape 函 数中需要不断地ifelse地去判断, ...
- cocos2dx-3.0(1)------win7 32位android环境搭建
參照链接http://blog.csdn.net/wonengxing/article/details/23601359 ----我的生活,我的点点滴滴!! 一. Android工具安装 1. 安装J ...
- Cocos2dx 3.0 过渡篇(二十六)C++11多线程std::thread的简单使用(上)
昨天练车时有一MM与我交替着练,聊了几句话就多了起来,我对她说:"看到前面那俩教练没?老色鬼两枚!整天调戏女学员."她说:"还好啦,这毕竟是他们的乐趣所在,你不认为教练每 ...
- 一张图总结Google C++编程规范(Google C++ Style Guide)
Google C++ Style Guide是一份不错的C++编码指南,我制作了一张比較全面的说明图,能够在短时间内高速掌握规范的重点内容.只是规范毕竟是人定的,记得活学活用.看图前别忘了阅读以下三条 ...
- 读书笔记:《为什么大猩猩比专家高明, How We Decide》
读书笔记:<为什么大猩猩比专家高明, How We Decide> 英文的书名叫<How We Decide>,可能是出版社的原因,非要弄一个古怪的中文书名<为什么大猩猩 ...
- Java正則表達式演示样例
import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexMatches { public s ...
- Get与Post的差别
Http定义了与server交互的不同方法,最主要的方法有4种,各自是GET,POST.PUT,DELETE. URL全称是资源描写叙述符.我们能够这样觉得:一个URL地址,它用于描写叙述一个网络上的 ...
- SSM框架整合( Spring 、 SpringMVC 和 Mybatis )
1.基本概念 1.1.Spring Spring 是一个开源框架, Spring 是于 2003 年兴起的一个轻量级的 Java 开发框架,由 Rod Johnson 在其著作 Expert O ...
- Good Luck Charlie(听力恢复训练)
系统的音标学习完毕后.在暑假进入了稍大强度的听力恢复训练.材料选择的是一部家庭情景喜剧片<Good Luck Charlie>,该剧是2010开播的.剧中运用到的大量词汇是和如今比較贴合的 ...
- ASP.NET 成员资格 Part.2(使用安全控件 Login)
原文:ASP.NET 成员资格 Part.2(使用安全控件 Login) 准备好提供程序以及用户信息的存储,就可以开始构建验证用户.注册用户或者让用户能够重置密码的用户界面了.ASP.N ...