The Linux Command Line Chapter 12

Slides:



Advertisements
Similar presentations
In the last Session… ls -l command seven fields nine permissions of a file ls -ld file ownership file permissions (three-tiered file protection system)
Advertisements

CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
A Guide to Unix Using Linux Fourth Edition
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.
Vi Editor TA for ITIS3100: Xu Fei
1 Using Editors Editors let you create and edit ASCII files UNIX normally includes two editors: vi and Emacs Vi and Emacs are screen editors: they display.
Starting Vi Opening an existing file vi filename Creating a new file vi filename In your workshop directory, create a new file called mysong vi mysong.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
Using Linux Text Editors. Use Non-Graphical Linux Text Editors Graphical Text Editor.
1 Unix Editors (ee, ed, ex, vi, vim) and Compilers (g77, gcc) Speaker: Li-Wen Chen Date:
Chapter 3 Mastering Editors
More on Linux - vi Opening Discussion zWhat did we talk about last class? zYou will use the command line a lot in this course. So lets review.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 7 Editing.
Introduction to Vim Robbie CSCI2100 Data Structures Tutorial 3.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
VIM  This is the text editor you will use on the workstation.  You can also edit the text files under windows environment and upload it to the workstation.
Editing, vi and Configuration Files Introduction to Linux June 16, 2009 Papeete, French Polynesia Hervey Allen.
UNIX Intro vi  vi is the standard UNIX text editor v Contents 1.Why use vi ? 2. vi Basics 3.Moving Around 4.Inserting Text.
Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines.
Tony Kombol.  Why text edit?  Many programs and features require configuration ▪ Configuration is kept in files ▪ Usually in the /etc directory  Changes.
Unix Session IV.
Text Editing February 2 nd, 2004 Class Meeting 3.
Chapter Three Text Editing1 System Programming Text Editing.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Chapter 9 Using Text Editors. vi Editor visual Editor, ASCII text editor, no formatting capabilities almost as powerful as MS Word, has 26 clipboards.
1 © 2012 John Urrutia. All rights reserved. Chapter 6 The vi Editor.
Getting Started with Linux Linux System Administration Editors.
Introduction to Unix (CA263) File Editing By Tariq Ibn Aziz.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Editing, vi and Configuration Files Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving Edited File Aborting Editing Session.
Agenda Using vi Editor Starting vi Session Command / Input Modes
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
Editing, vi and Configuration Files Unix/Linux Preparation Course June 27, 2010 Pago Pago, American Samoa
Getting Started with Linux Linux System Administration Editors.
CS:414 introduction to Unix and Linux
Getting started with CentOS Linux
Vim basics Vi IMproved.
Guide To UNIX Using Linux Third Edition
Editing, vi and Configuration Files
Vi Editor.
Vim.
Vi Introduction Tony Kombol.
Linux 104 Training Module File Editing.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Linux.
Linux System Administration Editors
The Linux Command Line Chapter 14
Tutorial of shell script
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
The Linux Command Line Chapter 12
vim Basics Understanding And Using the vim Text Editor
Emacs CSC 135.
C151 Multi-User Operating Systems
The Linux Command Line Chapter 24
The Linux Command Line Chapter 9
Run Java file with Window cmd
Getting started with CentOS Linux
The Linux Command Line Chapter 17
Chapter 2 Basic vi Editor.
The Linux Command Line Chapter 14
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
In the last class… The vi basics command, input and ex mode
The Linux Command Line Chapter 24
Presentation transcript:

The Linux Command Line Chapter 12 A Gentle Introduction to vi Prepared by Dr. Reyes, New York City College of Technology

vi Editor vi is a text editor that is always available in Unix/Linux systems. It is a light way text editor It is very fast It is difficult to use compared to other text editors such as gedit and nano Modern versions of Linux include vim, that is a user-friendlier version of vi Has two modes: Editing or Insert mode (pressing i or a) Command mode (pressing ESC key)

Starting vi vi – Command to start the vi editor To start vi and create a new file use vi followed by the file name. For example:

Saving Your Work To save your work you need to be in Command mode (press ESC key) :w - command in vi to write or save your work

Exiting vi :q – command used to quit vi :q! – command used to quit vi without saving any changes If in Insert mode, press the ESC key to go to Command mode

Navigating in vi

vi Editor i – vi command used to insert text a – vi command used to append text A – vi command to append at the end of the line After using i, a or A vi will switch to Insert mode and then you will be able to type.

Deleting in vi

Copy (yank) and paste in vi p – vi command used to paste text u – vi command to undo

Searching in vi f – vi command to search a single character in the current line. / – vi command to search a word or phrase in the entire file. Example for searching the word “Line”

vi Resources vim Tutorial: http://www.openvim.com/tutorial.html vim Adventures Game: http://vim-adventures.com/ vim Genius: http://www.vimgenius.com/