vi editor.pptx

Upload: vasunews

Post on 02-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 vi Editor.pptx

    1/58

    The vi Editor

  • 8/10/2019 vi Editor.pptx

    2/58

    The vi Editor

    The three modes of vi Editor:1.Command Mode: The default mode of the editor

    where every key pressed is interpreted as a

    command to run on text. To copy, delete text &

    navigate, this mode is used.

    2.Input Mode: Every key pressed after switching to

    this mode actually show up as text. To input text,

    this mode is used.3.ex Mode(Last Line Mode): The mode used to

    handle files (like saving) and perform

    substitution.

  • 8/10/2019 vi Editor.pptx

    3/58

    The vi Editor

  • 8/10/2019 vi Editor.pptx

    4/58

    INPUT MODEENTERING AND REPLACING TEXT

  • 8/10/2019 vi Editor.pptx

    5/58

    INPUT MODEENTERING AND REPLACING TEXT

    Insertion of Text (i and a)

  • 8/10/2019 vi Editor.pptx

    6/58

    INPUT MODEENTERING AND REPLACING TEXT

    Insertion of Text at Line Extremes (I and A)

  • 8/10/2019 vi Editor.pptx

    7/58

    INPUT MODEENTERING AND REPLACING TEXT

    Opening a New Line (o and O)

  • 8/10/2019 vi Editor.pptx

    8/58

    INPUT MODEENTERING AND REPLACING TEXT

    Replacing Text (r, s, R and S)

  • 8/10/2019 vi Editor.pptx

    9/58

    INPUT MODEENTERING AND REPLACING TEXT

    Replacing Text (r, s, R and S)

  • 8/10/2019 vi Editor.pptx

    10/58

    INPUT MODEENTERING AND REPLACING TEXT

    Input Mode Commands

  • 8/10/2019 vi Editor.pptx

    11/58

    ex MODE SAVING TEXT AND QUITTING

    Saving the Work (:w)

  • 8/10/2019 vi Editor.pptx

    12/58

    ex MODE SAVING TEXT AND QUITTING

    Saving and Quitting (:x and :wq)

  • 8/10/2019 vi Editor.pptx

    13/58

    ex MODE SAVING TEXT AND QUITTING

    Aborting Editing (:q)

  • 8/10/2019 vi Editor.pptx

    14/58

    ex MODE SAVING TEXT AND QUITTING

    Writing Selected Lines

  • 8/10/2019 vi Editor.pptx

    15/58

    ex MODE SAVING TEXT AND QUITTING

    Writing Selected Lines

  • 8/10/2019 vi Editor.pptx

    16/58

    ex MODE SAVING TEXT AND QUITTING

    Escape to the UNIX Shell (:sh and [Ctrl-z])

  • 8/10/2019 vi Editor.pptx

    17/58

    ex MODE SAVING TEXT AND QUITTING

    Recovering from a Crash (:recover andr)

  • 8/10/2019 vi Editor.pptx

    18/58

    ex MODE SAVING TEXT AND QUITTING

    Save and Exit Commands of the ex Mode

  • 8/10/2019 vi Editor.pptx

    19/58

    Command MODE NAVIGATION

    Movement in the Four Directions (h, j, k and l)

  • 8/10/2019 vi Editor.pptx

    20/58

    Command MODE NAVIGATION

    Movement in the Four Directions (h, j, k and l)

  • 8/10/2019 vi Editor.pptx

    21/58

    Command MODE NAVIGATION

    Word Navigation (b, e and w)

  • 8/10/2019 vi Editor.pptx

    22/58

    Command MODE NAVIGATION

    Moving to Line Extremes (0, | and $)

  • 8/10/2019 vi Editor.pptx

    23/58

    Command MODE NAVIGATION

    Moving to Line Extremes (0, | and $)

  • 8/10/2019 vi Editor.pptx

    24/58

    Command MODE NAVIGATION

    Scrolling ([Ctrl-f], [Ctrl-b], [Ctrl-d] and [Ctrl-u])

  • 8/10/2019 vi Editor.pptx

    25/58

    Command MODE NAVIGATION

    Absolute Movement (G)

  • 8/10/2019 vi Editor.pptx

    26/58

    Command MODE EDITING TEXT

    Editing TextDeleting characters (x, X)

  • 8/10/2019 vi Editor.pptx

    27/58

    Command MODE EDITING TEXT

    Editing TextDeleting lines (dd)

  • 8/10/2019 vi Editor.pptx

    28/58

    Command MODE EDITING TEXT

    Editing TextMoving Text (p, P)

  • 8/10/2019 vi Editor.pptx

    29/58

    Command MODE EDITING TEXT

    Editing TextCopying Text (y and p)

  • 8/10/2019 vi Editor.pptx

    30/58

    Command MODE EDITING TEXT

    Editing TextJoining Lines (J)

  • 8/10/2019 vi Editor.pptx

    31/58

    Command MODE EDITING TEXT

    Undoing Last Editing Instructions (u and U)

  • 8/10/2019 vi Editor.pptx

    32/58

    Command MODE EDITING TEXT

    Repeating the Last Command (.)

  • 8/10/2019 vi Editor.pptx

    33/58

    Command MODE EDITING TEXT

    Repeating the Last Command (.)

  • 8/10/2019 vi Editor.pptx

    34/58

    Command MODE EDITING TEXT

    Searching for a Pattern ( / and ? )

  • 8/10/2019 vi Editor.pptx

    35/58

    Command MODE EDITING TEXT

    Repeating the Last Pattern Search (n and N)

  • 8/10/2019 vi Editor.pptx

    36/58

    Command MODE EDITING TEXT

    Search and Repeat Commands

  • 8/10/2019 vi Editor.pptx

    37/58

    ex MODE

    Substitution Search and Replace ( :s )

  • 8/10/2019 vi Editor.pptx

    38/58

    ex MODE

    Substitution Search and Replace ( :s )

  • 8/10/2019 vi Editor.pptx

    39/58

    ex MODE

    Substitution Search and Replace ( :s )

  • 8/10/2019 vi Editor.pptx

    40/58

    Basic File Attributes

    ls -lListing File Attributes

  • 8/10/2019 vi Editor.pptx

    41/58

    Basic File Attributes

    1. File Type and Permissions

    2. Links

    3. Ownership

    4. Group Ownership

    5. File Size

    6. Last Modification Time7. Filename

  • 8/10/2019 vi Editor.pptx

    42/58

    Basic File Attributes

    Thed Option: Listing Directory Attributes

  • 8/10/2019 vi Editor.pptx

    43/58

    Basic File Attributes

    File Ownership

  • 8/10/2019 vi Editor.pptx

    44/58

    Basic File Attributes

    File Permissions

    Categories

    1. Owner (User)2. Group Owner

    3. Others (World)

    Permissions

    1. Read2. Write

    3. Execute

  • 8/10/2019 vi Editor.pptx

    45/58

    Basic File Attributes

    chmod: Changing File Permissions

  • 8/10/2019 vi Editor.pptx

    46/58

    Basic File Attributes

    Relative Permissions (Symbolic Codes)

  • 8/10/2019 vi Editor.pptx

    47/58

    Basic File Attributes

    Relative Permissions (Symbolic Codes)

  • 8/10/2019 vi Editor.pptx

    48/58

    Basic File Attributes

    Relative Permissions (Symbolic Codes)

  • 8/10/2019 vi Editor.pptx

    49/58

    Basic File Attributes

    Relative Permissions (Symbolic Codes)

  • 8/10/2019 vi Editor.pptx

    50/58

    Basic File Attributes

    Relative Permissions (Symbolic Codes)

  • 8/10/2019 vi Editor.pptx

    51/58

    Basic File Attributes

    Absolute Permissions (Octal Codes)

  • 8/10/2019 vi Editor.pptx

    52/58

    Basic File Attributes

    Absolute Permissions (Octal Codes)

  • 8/10/2019 vi Editor.pptx

    53/58

    Basic File Attributes

    Absolute Permissions (Octal Codes)

  • 8/10/2019 vi Editor.pptx

    54/58

    Basic File Attributes

    Using chmod Recursively (-R)

  • 8/10/2019 vi Editor.pptx

    55/58

    Basic File Attributes

    chownChanging File Owner

  • 8/10/2019 vi Editor.pptx

    56/58

    Basic File Attributes

    chownChanging File Owner

  • 8/10/2019 vi Editor.pptx

    57/58

    Basic File Attributes

    chgrpChanging Group Owner

  • 8/10/2019 vi Editor.pptx

    58/58

    Basic File Attributes

    chgrpChanging Group Owner