Category: ASP Linux

How to edit a text file in Linux Redhat:

  1. Log into your Redhat server using PUTTY or similar application
  2. To open a file with the standard text editor type ‘vi’  at a shell prompt
  3. To add text, press ‘i’ (for Insert mode). This will allow you to make modifications
  4. To exit insert mode, press ‘Esc’, vi will revert to Normal mode
  5. To exit vi, press ‘:’ (which is the vi command mode) and press ‘q’ then ‘Enter’
  6. If you have made changes to the text file that you want to save, press ‘:’ and type ‘w’ then ‘q’ to write your changes to the file and exit the application
  7. If you accidentally made changes to a file and you want to exit vi without saving the changes, type ‘:’ and then type ‘q’ followed
    by ”, which exits without saving changes.

More information about using vi can be found by typing ‘man vi’ at a shell prompt.

Tags:

Linux

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.