Searching in vi

General support questions
Post Reply
didko6
Posts: 3
Joined: 2015/04/01 21:16:52

Searching in vi

Post by didko6 » 2015/05/19 12:39:37

Hello guys,

i have a question about VI .If anyone knows how to search when i enter in a directory.For example i enter in vi /etc/localdomains and there is a list of domains.Which button/buttons i have to use to search ?

Thank you in advance!

Regards

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Stupid question

Post by TrevorH » 2015/05/19 13:23:28

Hit Esc to make sure you're in command mode then type /string to search for string.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

didko6
Posts: 3
Joined: 2015/04/01 21:16:52

Re: Stupid question

Post by didko6 » 2015/05/19 13:44:30

Thank you for answer, but unfortunately i didnt have success with that :(

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Stupid question

Post by scottro » 2015/05/19 17:15:48

I'm editing the post title to better reflect what it's about. Always try to choose meaningful subject lines.

To make sure we understand what you're asking.

You have a file, say it's called /etc/domains

You want to find the line scottro.net in that file

You hit escape, to be sure you were in command mode, You then typed

/scottro

and it appeared at the bottom of the file.

You then hit enter. The cursor didn't go to the line that said scottro.net. Did it go to anything similar, for example, maybe you also had scott.net and it went there, because you had mistyped and only typed scott, rather than scottro?
New users should check the FAQ and Read Me First pages

Post Reply