28. Nov 2005

Important Commandline Magic

Login to my server:
ssh -l gene o.nadir.net

Copy a file from o to the local computer:
scp gene@o.nadir.net:singularstrategies.net/index.html .

Copy a local file to o:
scp index.html gene@o.nadir.net:singularstrategies.net/index.html

Open a file in a Mac OS X Terminal to edit:
open -e index.html

List local files: ls
Create Directory: mkdir myDirectory
Remove file: rm myFile

Open file with VI:
vi filename.html

Write to file:
[esc] :w[enter]

Write to file and Quit:
[esc] :wq[enter]

Don't write to file and Quit:
[esc] :q![enter]

cut out the line under the cursor:
[esc] dd

cut out 5 lines starting under the cursor:
[esc] d5d

paste what you've been cutting out before:
[esc] p

Insert here:
[esc] i

Insert at end of line:
[esc] A

Undo:
[esc] u

VI Tutorial

Posted by barbie at 16:35
May 2012
Sun Mon Tue Wed Thu Fri Sat
   
   
Categories
Search

Advanced Search
Archives
Recent Entries
Important Commandline Magic
Links
rocket
david
missmonorom
anatomix
sistero
nathan in berlin
Syndicate this site (XML)