Guide To UNIX Using Linux Third Edition

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Linux+ Guide to Linux Certification, Second Edition
Chapter 5 Editing Text Files
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.
Guide To UNIX Using Linux Third Edition
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
CS465 - UNIX The vi Editor. Creating Files Most human-readable files on Unix are created with a text editor Unix has many, many different editors ed a.
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 Text Editors Creating files on the Unix system.
Chapter 3 Mastering Editors
Guide To UNIX Using Linux Fourth Edition
Chapter 3: The UNIX Editors ASCII and vi Editors.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
T HE VI EDITOR. vi has 2 modes: command mode (initial or "default" mode) insert mode [Esc] is used to switch to command mode. In general, vi commands:
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.
Word Lesson 2 Basic Editing
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
Microsoft Office Illustrated Introductory, Second Edition Documents Editing.
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.
Editors And Debugging Systems Other System Software Text Editors Interactive Debugging Systems UNIT 5 S.Sharmili Priyadarsini.
Chapter 5 Editing Text Files. Basic Concept A text editor works on a file buffer that is a memory copy of a disk file The disk file is not updated until.
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.
Unix Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
Unix Session IV.
1 of 47 Chapter 4: The vi Editor – First Look Copyright ©2008 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.
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.
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.
Chapter Three The UNIX Editors.
Linux Class #03. File Access Permissions Types of users in Linux: Local User (u) Group User (g) Other User (o) Each User can have 3 types of permissions:
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
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 14 – UNIX vi text editor.
1 Word Lesson 2 Basic Editing Microsoft Office 2010 Introductory Pasewark & Pasewark.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Exploring Microsoft Word
Excel Tutorial 8 Developing an Excel Application
Word Lesson 1 Word Basics
Lesson 5-Exploring Utilities
SUSE Linux Enterprise Desktop Administration
Vim basics Vi IMproved.
UNIX MULTIPLE CHOICE QUESTION.
Topics Introduction Hardware and Software How Computers Store Data
Vi Editor.
Unix Fundamentals - Part iii vi Editor
Linux 104 Training Module File Editing.
Lecture 3 More on editors: emacs and vi COP 3344 Introduction to UNIX.
Linux System Administration Editors
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
Unit# 8: Introduction to Computer Programming
Exploring Microsoft Word
CREATING, PRINTING, AND EDITING DOCUMENTS
Guide To UNIX Using Linux Third Edition
Topics Introduction Hardware and Software How Computers Store Data
Chapter Four UNIX File Processing.
Chapter 2 Basic vi Editor.
Linux Operations and Administration
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
Exploring Microsoft Word 2003
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
Exploring Microsoft Word 2003
The Linux Command Line Chapter 12
Presentation transcript:

Guide To UNIX Using Linux Third Edition Chapter 3: Mastering Editors Guide To UNIX Using Linux Third Edition

Objectives Explain the basics of UNIX/Linux files, including ASCII, binary, and executable files Understand the types of editors Create and edit files using the vi editor Create and edit files using the Emacs editor Guide to UNIX Using Linux, Third Edition

Understanding UNIX/Linux Files Almost everything you create in UNIX is stored in a file All information stored in files is in the form of binary digits Binary digits are also known as bits Bits have two states: 1 (on) and 0 (off) 0’s and 1’s as a way to communicate with a computer is known as machine language Guide to UNIX Using Linux, Third Edition

Understanding UNIX/Linux Files (continued) Machine language (or bit combinations) is translated into plain English using ASCII ASCII stands for American Standard Code for Information Interchange ASCII uses a byte (a string of 8 bits) to represent keyboard characters such as letters and numbers Text files contain printable, ASCII characters Binary files contain nonprintable characters, or machine language Guide to UNIX Using Linux, Third Edition

Guide to UNIX Using Linux, Third Edition

Executable Program Files Programmers develop source code as text files that are compiled before being executed Programmers also create scripts, which are files containing commands; scripts are interpreted Executable program files are compiled and interpreted files that can be run Guide to UNIX Using Linux, Third Edition

Using Editors Editors let you create and edit ASCII files UNIX/Linux normally include two editors: vi and Emacs vi and Emacs are screen editors: they display the text you are editing one screen at a time Guide to UNIX Using Linux, Third Edition

Using the vi Editor Called vi because it is visual; it immediately displays on screen the changes that you make to text Works in three modes Insert: lets you enter text Command: lets you enter editing commands Extended (ex) command set: lets you use an extended set of editing commands Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) To create a new file in the vi editor, type vi and the name of the new file at the command prompt Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) When started, the vi editor is in command mode To insert text into a file, you must switch to insert mode You can repeat the line just entered with the repeat command (.) To edit what you’ve just typed, move the cursor with the various keyboard cursor movement keys Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) In order to insert text, you issue the “i” command to enter insert mode (Figure on page 131) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) While still in command mode: To delete text, move to a character and then type “x” You can undo a command (reverse its effects) by typing “u” To search for a text pattern, type a forward slash (/), type the pattern, and press Enter Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) The status line at the bottom of the screen displays information, including line-oriented commands and error messages (Figure on page 136) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Searching and replacing is a line-oriented command that executes independently of the cursor position (Figure on page 137) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Saving a file and exiting vi You should always save the file before exiting vi, otherwise changes are lost To save a file and continue working on it, type the :w (write) command While in command mode, use the :wq (write and quit) command to save and exit iv, or the :zz command to exit after saving You can also use :x to save and exit Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) In vi, you can also: Add text from another file Leave vi temporarily to perform other UNIX/Linux tasks, then return to your file Change your display while editing, such as adding line numbering Copy, cut, and paste text to help editing Print text files Cancel an editing session Get help Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the vi Editor (continued) Turn on line numbering when you want to work with a range of lines and refer to the line numbers to specify text (Figure on page 141) Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor More complex than vi, but it is more consistent Not modal Supports a sophisticated, extensible macro language Reputed to have more features than any other UNIX/Linux program Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) Creating a new file in Emacs Type the Emacs command with the name of the new file after it at the command line If you are using the GNOME interface, start Emacs by clicking the Main Menu icon, clicking Programs, clicking Applications, and then clicking Emacs Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) The menu bar at the top of the Emacs screen has categories for commands File: Options for file operations Edit: Text-editing functions Options: Special options Buffers: Access to storage buffers Tools: Options for extra tool functionality Help: Access to manuals and other help tools Guide to UNIX Using Linux, Third Edition

Using the Emacs Editor (continued) Editing an Emacs file To navigate the cursor location, use the arrow keys, or Ctrl key combinations Text is inserted by typing Ctrl+x and then “u” is the undo command You can cut, copy and paste text There is a text search feature as well Lets you format documents with word wrap Guide to UNIX Using Linux, Third Edition

Reformatting a File Use the Alt+q command to turn on the word wrap feature in Emacs (Figure on page 147) Guide to UNIX Using Linux, Third Edition

Chapter Summary Bytes are computer characters stored using numeric code (e.g., ASCII) The vi editor is a popular choice among UNIX/Linux users to edit text files Emacs editor Popular alternative to vi Has a powerful extensible command syntax Navigate an Emacs file with cursor movement keys or Ctrl key combinations Guide to UNIX Using Linux, Third Edition