Thread: freespire
View Single Post
easy editing
Old
  (#3 (permalink))
midwest
blink and it's over
midwest will become famous soon enough
 
midwest's Avatar
 
Status: Offline
Posts: 802
Join Date: Oct 2002
Location: Big Sky, MT
Rep Power: 78
easy editing - 11-02-2006, 09:45 PM

With freespire editing some files can be bothersome unless you login as root. An easy way is to run vi as sudo. We will use the proftpd.conf file as an example.
at the command prompt(open a terminal) type:
sudo vi /etc/proftpd.conf
a text based editor will open the file. If the file does not exist it will be created. To get in edit(inseert) mode hit the "i" key. You will see at the bottom of the screen --INSERT--

In the top left corner will be a clack rectancle the size of a character. Use the arrow keys to move it around. You insert behind it.

In this case we will edit the file to allow use to see hidden files. Near the bottom of the file you will see "list options" the setting is -l, this means list files. we want it to be "-la" so insert an "a". Now we need to save the file. To do so we need to leave insert mode. hit the "esc" key. to enter commands you use the colon key. The command we want to use in this instance is wq. This stands for "write" then "quit" and it would look like this in the lower left;
:wq
hit the "enter" key
thats it. We have used vi to edit a file.

In command mode the most useful commands are
dd delete this line
#dd delete this number of lines ex 4dd delete 4 lines
G go to end of line
o create a new line below,move cursor to new line,enter insert mode

vi is the most text editor you will find for ease of use and quickness in a development environment. Learning to use it will make html and php coding much easier.

a good easy to use tutorial
http://www.cs.colostate.edu/helpdocs/vi.html

just the commands
http://www.chem.brown.edu/instructions/vi.html

then of course there is emacs type "emacs" at the prompt for a view of the most powerful file editor in the universe.


Ronnie Gauthier
www.instaguide.com

======================
for official page-zone support please visit
www.page-zone.com/support.shtml
   
Reply With Quote