The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 08-31-2007
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Quote:
Originally Posted by deepti.1104 View Post
I have a file say x and i need to update with some values in it, and check te output. I need the commands to edit the file, save the file , run the file and how to insert the text and delete the text in the file in bash(bourne shell). Please give me these commands. that shud help me.

thanks
Deepti,here are the commands that can help you..
file name is x--

1.. vi x --> file is open in commad mode.
2.. for navigation in vi use these commands-
a. h->to move left
b. j->to move down
c. k-> to move up
d. l-> to go right

3.. To write something in vi you have to press i or a to put u in insert mode or append mode.write something in file.

4.. press x to delete a word,dd to delete a line,r to replace a word.
5.. see man vi ->there are so m any commands to do editing and navigation.
6.. To save press escape :wq ->it will save and exit.
escape :w ->only save
escape :q quit
escape :q! ->quit without save.

Thanks,
Namish