Presentation is loading. Please wait.

Presentation is loading. Please wait.

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)

Similar presentations


Presentation on theme: "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)"— Presentation transcript:

1 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) changing file permissions - chmod relative permissions

2 Changing file permissions – chmod –Absolute permissions –The security implications –Using chmod recursively (-R) Directory permissions Changing file ownership –chown –chgrp

3 THE vi EDITOR

4 CONTENTS The vi basics Input mode – entering and replacing text Saving text and quitting – the ex mode Navigation Editing text

5 vi basics To write and edit some programs and scripts, we require editors UNIX provides vi editor for BSD system – created by Bill Joy Bram Moolenaar improved vi editor and called it as vim (vi improved) on Linux OS

6 vi Command mode non existant lines Input mode enter, edit text Current cursor position Current line

7 ctrl-w to delete any wrong word esc to return to command mode Beep indicates a key pressed unnecessarily Ex mode – execute mode – last line mode :x saves file on disk and shifts the control from editor to prompt mode ($)

8 Command mode copy and delete text, can’t enter or replace text Input mode every key pressed is a text ex mode save and perform substitution by pressing : and get back to default command mode

9 THE REPEAT FACTOR vi provides repeat factor in command and input mode commands Command mode command k moves the cursor one line up 10k moves cursor 10 lines up

10 Undo whenever you make a mistake esc u Clearing the screen in command mode ctrl-l Don’t use (capslock) vi commands are case-sensitive Avoid using the PC navigation keys

11 INPUT MODE :set showmode messages like INSERT MODE, REPLACE MODE, CHANGE MODE, etc will appear in the last line Pressing ‘i’ changes the mode from command to input To append text to the right of the cursor position, we use a, text

12 I and A behave same as i and a, but at line extremes I inserts text at beginning of line A appends text at end of line Opening a new line o opens a new line below the current line

13 r replacing a single character s replacing text with s R replacing text with R Press esc key to switch to command mode after you have keyed in text

14 INPUT MODE COMMANDS COMMANDFUNCTION iinserts text aappends text I inserts at beginneing of line A appends text at end of line oopens line below O opens line above r replaces a single character sreplaces with a text Sreplaces entire line

15 SAVING TEXT AND QUITTING :Wsaves file and remains in editing mode :xsaves and quits editing mode :wqsaves and quits editing mode :w save as :w! save as, but overwrites existing file :qquits editing mode :q!quits editing mode by rejecting changes made :sh escapes to UNIX shell :recover recovers file from a crash

16 THANK YOU


Download ppt "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)"

Similar presentations


Ads by Google