Antony's Logo

Antony's pages of stuff

  • Geek Home
  • HTML & Web Code
    • 2d Canvas
    • 3d Canvas
    • Javascript
  • Command Line
    • Windows CL
    • Windows CL Elevated
    • Windows Powershell
    • Unix & Linux
  • Other Stuff
    • Electronics
    • TV & Radio
    • Excel
    • Powerpoint
    • Word
  • Contact

F*@#ing Vi



Things I have found out whilst learning about Vi



What about vi ?

vi is the (visual editor) for Unix / Linux.

The vi editor is a full screen editor and has two modes of operation:

      Command mode commands which cause action to be taken on the file, and
      Insert mode in which entered text is inserted into the file.

Lets Look at the Syntax in use.

From command line type vi [/filepath/filename] you may need sudo if it requires elevated rights to save

sudo vi /var/www/html/index.html

In the Command Mode

  • : initiates a vi command
  • ! initate a shell command
  • : this is a shell builtin command with empty output
  • > redirect the output
  • % vi substitutes this with the name of the current file
  • From the Insert mode to exit vi press (Escape) key to return to Command Mode:

    To Exit the Command Mode you have 'no save' or 'save' options:

        :q!    - Quit without writing changes to file
        :wq   - Write changes to file and quit vi

    Other

Jump to Ubuntu, Linux and me on....

  • Uncomplcated Fire Wall (UFW)
  • Fail2ban
  • HandBrakeCLI
  • Screen
  • htpassword
  • apt
  • Nginx
  • CHOWN
  • rsync
  • youtube-dl
  • vi

by Ant Monkey on Juice © 

Contact me here