Linux text editing

From Carl R. Woese Institute for Genomic Biology - University of Illinois Urbana-Champaign
Revision as of 08:12, 20 September 2012 by Nevoband (talk | contribs)
Jump to navigation Jump to search

Linux Text Editing[edit]

Create a text file using vi[edit]

  • To create a file called foo.txt (or edit a file called foo.txt):
vi foo.txt
  • This will also start the vi editor and you should see a blank screen.
  • To switch vi into text insertion mode simply type :i and hit Enter
  • You should now see -- INSERT -- at the bottom of the screen which means vi is ready to accept text
  • Now simply type in what ever text you would like just like you would on a normal text editor.
  • once you are done hit Esc on the keyboard and vi should leave text insertion mode.
  • To save the file type :wq this will write to the file foo.txt and quit vi.
  • To edit the file simply follow the same procedure