LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-07-2016, 03:36 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,020

Rep: Reputation: Disabled
Post How can I search a text in man pages?


Hello.
I open "ls" man page via "man ls" but how can I search this man page for specific string?

Tnx.
 
Old 06-07-2016, 03:43 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,025
Blog Entries: 1

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112
/string forward
?string backward
 
1 members found this post helpful.
Old 06-07-2016, 04:36 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,511

Rep: Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434
you can set PAGER=less or any other program you wish and you can use all the features of that app. Or you can redirect the output into a text file and work with that. (see man man)
 
1 members found this post helpful.
Old 06-07-2016, 06:41 AM   #4
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,020

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by astrogeek View Post
/string forward
?string backward
Is you mean for example "man ls /-A" ?
 
Old 06-07-2016, 06:45 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,511

Rep: Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434
No he did not mean
Quote:
man ls /-A
you wrote:
Quote:
I open "ls" man page via "man ls"
And now just press /-A for example.
 
Old 06-07-2016, 09:00 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,480
Blog Entries: 10

Rep: Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641Reputation: 1641
Quote:
Originally Posted by hack3rcon View Post
Is you mean for example "man ls /-A" ?
No. Enter the man page as you have done, then press the forward slash and it will allow you to type in a string to search for.

Few additional things:
- If it finds one or more matches for the string, you can press letter "n", no quotes just press n and it will find "next"

But rather than everyone give you individual tips, when you are in a manual page you can type the letter h to get help and it will show you all of what people are talking about here, and much, much more. A lot of it is very similar to the vi interface if you happen to know some of that.
 
1 members found this post helpful.
Old 06-07-2016, 11:15 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,514
Blog Entries: 1

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
There's some hotkeys for man to navigate. [HOME] for the top. [END] for the bottom. [/] to enter a search string. [/] by itself and enter to search for the same string again. [q] to quit. Many of these keys also work in other things like "less".
 
Old 06-07-2016, 01:18 PM   #8
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
There's some hotkeys for man to navigate. [HOME] for the top. [END] for the bottom. [/] to enter a search string. [/] by itself and enter to search for the same string again. [q] to quit. Many of these keys also work in other things like "less".
If your system pager is less then you are viewing man pages with less.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Exact Keyword Search within Man Pages? kingisw Linux - Newbie 4 10-14-2011 02:44 PM
Search in man pages CartmanYO Linux - General 13 06-11-2010 08:13 AM
how to search man pages parnal88 Linux - Newbie 7 05-06-2010 12:43 AM
Search the 'man' pages mr tim esquire Linux - Newbie 6 07-28-2008 11:37 PM
Search all man pages for a phrase suguru Linux - Software 1 09-12-2004 07:38 AM


All times are GMT -5. The time now is 01:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration