Solved

VI Editing

Posted on 1997-09-16
2
251 Views
Last Modified: 2013-12-16
Greetings

I am looking for a vi command to replace a string in my passwd file.
Eg.:
 .......:/home/username:bin/xsh ,I want to replace the dir. /home with
/export/home.

To change /home for eg. to /export I use the following command:
:g/home/s/home/export/, How do I change /home to /export/home

Thanks
Vulcan

0
Comment
Question by:Vulcan081897
2 Comments
 
LVL 5

Accepted Solution

by:
n0thing earned 50 total points
ID: 1812696
Hi,
   "/" is a reserved word .. so in order to say you want a "/"
you have to append "\" before it ... so "\/" is a "/"

:%/\/home/\/export\/home/g
or
:g/\/home/\/export\/home/

Regards,
Minh Lai

0
 

Author Comment

by:Vulcan081897
ID: 1812697
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question