introductioninstalling redhatunix commandsediting filesssh
sitemapapacheftptcp/ipmisc-notesresources

Quick and dirty text editing in a Unix shell with pico.
Here’s How:  We’ll call the file you want to edit foobar.html.  In a terminal window cd (change directory) to the location of the file you want to edit.  So if foobar.html’s location is /www/wwwroot/aoce/foobar.html, type “cd /www/wwwroot/aoce.  Then launch pico calling up the file you want to edit, “pico foobar.html”.  The syntax is pico filename.  You can also edit a file without being in the location of the file by giving pico the full path to the file.  Example:  pico /www/wwwroot/aoce/foobar.html.  To create a new file just type pico without giving a filename.  Pico will launch with a blank page ready for editing.  The commands like cut/copy/paste/find etc. are listed at the bottom of the screen.  If you are unsure how to do something just look at the help.  To issue a command the syntax is ctrl + letter.  Here is a list of most commonly used commands.

Command Keystrokes Pc / Mac equivalent
WriteOut ctrl + o Save
Exit ctrl + x Exit
Next Page ctrl + v Page Down
Prev. Page ctrl + y Page Up
Cut Text ctrl + k Cut
Uncut Text ctrl + u Paste
Where is ctrl + w Find
Cursor Pos ctrl + c Cusor Position
Help ctrl + g Help
     

 

When you save a file it asks if you want to save as “and it lists the current name of the file that you are editing”  If you want to perform a save as just change the name.