Searching & Replacing in vi

One of vi"s better features (và advantages over pico) is that it allows you khổng lồ search & replace throughout entire files. As shown in the next sections, you can just find a specific string of text (a regular expression, in Unix lingo; see Figure 4.14), or you can find the text và replace it with other text, as in Figure 4.15.

Bạn đang xem: Searching and replacing in vi


Figure 4.14 Searching for text in vi is quichồng and reliable.


Figure 4.15 Replacing text in vi requires a bit of arcane syntax, but you get used khổng lồ it quickly.

To find a string of text in vi:

vi hairyspider

For starters, access vi và a specific file.


Enter comm& mode, then type / followed by the text you"re looking for. Here, we"re looking for "spider," but you may be looking for "the fly" or "wiggled & jiggled & tickled inside her." Or whatever.

Press to find the first occurrence of the term. Type n to find the next one.

To tìm kiếm & replace in vi:

vi hairyspider

For starters, access vi & a specific tệp tin.


A great use for the search-and-replace feature is if you kết thúc up with DOS text files in your Unix tài khoản (by uploading a text file from a Windows machine as a binary file, most likely). If you view DOS files through a Unix shell, all the lines in the tệp tin will kết thúc with ^M. But if you try to type ^M when you"re doing a tìm kiếm & replace, the ^M won"t show up. What to do? Press , then . Just search and replace with :%s/
//g. The commvà "escapes" the following character, so you can press it without actually doing what the commvà would otherwise bởi vì. If you don"t escape the , vi thinks you just pressed and tries lớn exexinh đẹp the unfinished command. See the section on grep in Chapter 6 for information about searching with regular expressions. Add a g at the kết thúc of the command to make it apply to all occurrences in the file. Otherwise, it applies only to lớn the first occurrence on each line.
Bachồng Page 12 of 17 Next > Promotional Mailings và Special Offers

I would like khổng lồ receive sầu exclusive sầu offers and hear about products from and its family of brands. I can unsubscribe at any time.

Privacy Notice


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products & services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy và describes how we collect, protect, use & nói qua personal information collected through this site. Please note that other Pearson websites & online products and services have sầu their own separate privacy policies.

Collection và Use of Information

To conduct business and deliver products and services, Pearson collects & uses personal information in several ways in connection with this site, including:

Questions & Inquiries

For inquiries & questions, we collect the inquiry or question, together with name, contact details (tin nhắn address, phone number & mailing address) & any other additional information voluntarily submitted khổng lồ us through a Liên hệ Us form or an gmail. We use this information khổng lồ address the inquiry & respond to lớn the question.

Online Store

For orders & purchases placed through our online store on this site, we collect order details, name, institution name và address (if applicable), gmail address, phone number, shipping and billing addresses, credit/debit card information, shipping options và any instructions. We use this information to lớn complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, và for related purposes.


Pearson may offer opportunities khổng lồ provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information khổng lồ evaluate, support, maintain and improve sầu products, services or sites; develop new products & services; conduct educational research; & for other purposes specified in the survey.

Contests và Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, liên hệ information and other information specified on the entry form for the conthử nghiệm or drawing khổng lồ conduct the conthử nghiệm or drawing. Pearson may collect additional personal information from the winners of a conchạy thử or drawing in order khổng lồ award the prize và for tax reporting purposes, as required by law.


If you have sầu elected to receive sầu email newsletters or promotional mailings & special offers but want khổng lồ unsubscribe, simply gmail ask

Service Announcements

On rare occasions it is necessary to lớn sover out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their tài khoản information. However, these communications are not promotional in nature.

Xem thêm: Phần Mềm Chuyển Phát Nhanh Trên App Store, Phần Mềm Chuyển Phát Nhanh

Customer Service

We communicate with users on a regular basis khổng lồ provide requested services và in regard to issues relating khổng lồ their tài khoản we reply via gmail or phone in accordance with the users" wishes when a user submits their information through our Contact Us size.

Other Collection & Use of Information

Application and System Logs

Pearson automatically collects log data lớn help ensure the delivery, availability và security of this site. Log data may include technical information about how a user or visitor connected khổng lồ this site, such as browser type, type of computer/device, operating system, internet service provider and IPhường address. We use this information for tư vấn purposes và khổng lồ monitor the health of the site, identify problems, improve sầu service, detect unauthorized access and fraudulent activity, prevent và respond khổng lồ security incidents và appropriately scale computing resources.

Web Analytics

Pearson may use third party website trend analytical services, including Google Analytics, khổng lồ collect visitor information, such as IP. addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect và report information on an anonymous basis, they may use cookies lớn gather web trkết thúc information. The information gathered may enable Pearson (but not the third các buổi tiệc nhỏ website trend services) to lớn links information with application và system log data. Pearson uses this information for system administration và lớn identify problems, improve service, detect unauthorized access và fraudulent activity, prsự kiện & respond to security incidents, appropriately scale computing resources và otherwise tư vấn & deliver this site và its services.

Cookies and Related Technologies

This site uses cookies & similar technologies lớn personalize nội dung, measure traffic patterns, control security, track use and access of information on this site, & provide interest-based messages and advertising. Users can manage and bloông chồng the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond khổng lồ Do Not Traông xã signals.


Pearson uses appropriate physical, administrative sầu và technical security measures to lớn protect personal information from unauthorized access, use và disclosure.


This site is not directed to children under the age of 13.


Pearson may sover or direct sale communications lớn users, provided that

Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising. Such sale is consistent with applicable law và Pearson"s legal obligations. Pearson will not knowingly direct or send sale communications to lớn an individual who has expressed a preference not khổng lồ receive sầu kinh doanh. Where required by applicable law, express or implied consent to marketing exists & has not been withdrawn.

Pearson may provide personal information khổng lồ a third tiệc nhỏ service provider on a restricted basis to lớn provide sale solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user"s personally identifiable information changes (such as your postal address or email address), we provide a way khổng lồ correct or update that user"s personal data provided lớn us. This can be done on the Account page. If a user no longer desires our service and desires to lớn delete his or her tài khoản, please liên hệ us at customer-service và we will process the deletion of a user"s trương mục.


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want lớn receive:

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevadomain authority residents may gmail a request for no sale of their personal information to NevadaDesignatedRequest

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson"s commitment to lớn comply with California law & applies lớn personal information of California residents collected in connection with this site và the Services.

Sharing và Disclosure

Pearson may discchiến bại personal information, as follows:

As required by law. With the consent of the individual (or their parent, if the individual is a minor) In response to lớn a subpoena, court order or legal process, to the extent permitted or required by law To protect the security và safety of individuals, data, assets & systems, consistent with applicable law In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to lớn the provisions of this Privacy Notice To investigate or address actual or suspected fraud or other illegal activities To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract To affiliated Pearson companies và other companies and organizations who perkhung work for Pearson & are obligated khổng lồ protect the privacy of personal information consistent with this Privacy Notice To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links lớn other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users lớn be aware when they leave sầu our site và lớn read the privacy statements of each và every website site that collects Personal Information. This privacy statement applies solely lớn information collected by this website site.

Requests and Contact

Please contact us about this Privacy Notice or if you have sầu any requests or questions relating to lớn the privacy of your personal information.

Xem thêm:

Changes khổng lồ this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective sầu date of the revision in the posting. Often, updates are made to lớn provide greater clarity or to lớn comply with changes in regulatory requirements. If the updates involve material changes khổng lồ the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please tương tác us if you have sầu questions or concerns about the Privacy Notice or any objection to any revisions.