Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Example: I am using tar -zxvf command but I don't know what 'x' stands for.

How can I check this single parameter without having to scroll all the way through man tar?

share|improve this question
    
Please check this [thread][1] on superuser.com. [1]: superuser.com/questions/441654/… –  Einar Aug 8 '13 at 20:41
add comment

4 Answers

up vote 9 down vote accepted

Search

x is for extract.

After you are inside man, type /-xenter to search info about the -x parameter,
Press n to jump to the next -x match, and N for the previous

Search with Regex

For large man pages, or a common terms, a little regex can be used to narrow the search.

If you just want the main entry, you can use /^ *-x to remove most extraneous matches.
This works as most man pages are formatted with the entry indented with spaces.

  • ^ * matches the start of line, with zero to many spaces.
  • -x is the search string.
share|improve this answer
add comment

You could also grep it out of the man page with some context:

man tar | grep -C5 -- '-x\b'
share|improve this answer
add comment

This works in RHEL6 with Bash

In .bashrc

add

function mans {
       man $1 | less -p "^ +$2"
}

start a new instance of bash

$ bash

now

mans ls -l

has the desired effect.

share|improve this answer
add comment

If you use Emacs, M-x man RET tar, then C-s -x.

Hit C-s repeatedly until you get to the right place, then hit return.

C-r is the same, but backwards. (But both will wrap on a double strike at document top/bottom.)

Also, in cases like this (man page search), case sensitive search is preferable. Examine the case-fold-search variable.

The huge advantage of using your editor to view man pages is that you know all commands so well - navigation, copying, everything you'd like to do, you already know how.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.