LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2011, 11:15 AM   #1
zeusys
Member
 
Registered: Jun 2006
Posts: 31

Rep: Reputation: 0
Question how to search in man


Hi
I want to know how I can search something like +o in a man page?
When I type /+o in man page,it says nothing to repeat (press ENTER).

please guide me
thank you
 
Old 09-01-2011, 11:22 AM   #2
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
You have the slash the wrong way. Try this:

Quote:
\+o
 
Old 09-01-2011, 11:33 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Note that "man" doesn't provide the search feature, the display program assigned to open them does. This is usually less, so have a look at its documentation.
 
Old 09-01-2011, 02:46 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by d072330 View Post
You have the slash the wrong way. Try this:
The slash is the search command. This is what the OP should enter:

Code:
/\+o
Also, I thought that less uses basic regular expressions, which don't interpret "+" as special unless it's preceeded by a backslash. The less man page doesn't say what it uses, though:

Quote:
Originally Posted by man less
The pattern is a regular expression, as recognized by the regular expression library supplied by your system.
 
1 members found this post helpful.
Old 09-01-2011, 02:55 PM   #5
zeusys
Member
 
Registered: Jun 2006
Posts: 31

Original Poster
Rep: Reputation: 0
please try this :
man 1p set

then try to search +o
\+o doesn't work

how I can less man pages? you mean something like this :
man 1p set | less
In this case I can't search for +o again.

(Note : I know it is not critical,but I am eager to learn )
 
Old 09-01-2011, 03:17 PM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
[QUOTE=zeusys;4459055]please try this :
man 1p set

Quote:
Originally Posted by zeusys View Post
then try to search +o
\+o doesn't work
You did first use the "/" command to start searching, right?

Quote:
Originally Posted by zeusys View Post
how I can less man pages? you mean something like this :
man 1p set | less
man uses less.
 
Old 09-02-2011, 01:57 AM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by zeusys View Post
please try this :

how I can less man pages? you mean something like this :
man 1p set | less
You (likely) don't need to do anything. You're already using it.

As I tried to explain before, the man command itself doesn't display the page; it just grabs the page you want from the database and formats it. Then it automatically outputs the results to the default pager, unless you override it. This should be less, unless you've changed it somewhere.

If I'm reading it correctly, the man command looks for the following to determine which pager to use, in order.

the -P option
an equivalent setting in the $MANOPT environment variable
the $MANPAGER environment variable
the $PAGER environment variable

Use one of these if you want to override the default.

Read the man man page for more.
Also read the man page of the pager it's using for how to use its search options.

Last edited by David the H.; 09-02-2011 at 02:04 AM. Reason: rewording to avoid confusion
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search in man pages CartmanYO Linux - General 13 06-11-2010 07:13 AM
how to search man pages parnal88 Linux - Newbie 7 05-05-2010 11:43 PM
Search the 'man' pages mr tim esquire Linux - Newbie 6 07-28-2008 10:37 PM
Search all man pages for a phrase suguru Linux - Software 1 09-12-2004 06:38 AM
How to make search on a 'man doc' satimis Linux - Newbie 3 10-06-2003 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration