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, ...
随机推荐
- birkenfeld / sphinx-contrib — Bitbucket
birkenfeld / sphinx-contrib — Bitbucket README for sphinx-contrib This repository contains a collect ...
- NAT ALG原理
1 NAT ALG简介 普通NAT实现了对UDP或TCP报文头中的的IP地址及端口转换功能,但对应用层数据载荷中的字段无能为力,在许多应用层协议中,比如多媒体协议(H.323.SIP等).F ...
- SocketAsyncEventArgs使用解说
原文:SocketAsyncEventArgs使用解说 如果在.NET下写过网络通讯的同学应该感觉不陌生了,有很多刚入门的同学很多都认为这东西可以大大提高处理效能还有就是使用上很不适应.其实使用之前最 ...
- hdu3555(数位dp)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3555 题意:求区间[a,b]内包含有'49'的数的总个数. 分析:dp[pos][0]表示到第pos位 ...
- android File文件的读写操作
本程序实现两个文本框和两个按钮,其中一个文本框和一个按钮用于读取文件内容.另一个文本框和另一个按钮用于写入. java代码: package com.example.activity; import ...
- 解决:Determining IP Information for eth0 一直停留 无法进入系统
问题场景: vm centos6.4网卡之前一直没异常,可今天启动时一直卡在Determining IP Information for eth0,无法进入系统.网上说了非常多办法,大多都是不着边的说 ...
- js实现页面重定位的几种方法
参考地址:http://www.cnblogs.com/super-d2/archive/2011/10/01/2197004.html js实现页面重定向 在现行的网站应用中URL重定向的应用有很多 ...
- 在Java中如何使用jdbc连接Sql2008数据库(转)
我们在javaEE的开发中,肯定是要用到数据库的,那么在javaEE的开发中,是如何使用代码实现和SQL2008的连接的呢?在这一篇文章中,我将讲解如何最简单的使用jdbc进行SQL2008的数据库的 ...
- CentOS 如何使用第三方软件库-EPEL与RPMForge、RPMFusion软件库
在CentOS下运行yum install flash-plugin或yum install mplayer的时候,提示库里没有找到这个软件?为什么会这样?因为CentOS是RHEL编译过来的,去掉了 ...
- 王立平--Failed to push selection: Read-only file system
往android模拟器导入资源,失败. 提示:仅仅读文件. mnt是仅仅读文件.应点击sdcard.,在导入