?
Solved

VI Editing

Posted on 1997-09-16
2
Medium Priority
?
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
n0thing earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

764 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