usually i use grep to search long man pages for certain options rather than going through the whole manual..however when i need to view the part related to certain option, grep interprets that option as its own which causes unexpected behaviour or displaying available options for grep..for instance i need to check what -r exactly does in userdel as in Code: man userdel | grep -r now grep modifies its behaviour accordingly, but i need it to search for -r in the man page instead.. Code: man grep | grep exact ddnt really help any suggestions ??
man userdel | grep -r
man grep | grep exact
M Abu Rahmeh ‘—so long as I get somewhere,’ Alice added as an explanation. ‘Oh, you’re sure to do that,’ said the Cat, ‘if you only walk long enough.’
Code: man userdel | grep -- -r -- = end options or Code: man userdel | grep -A 10 -- -r -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.
man userdel | grep -- -r
man userdel | grep -A 10 -- -r
Last edited by sisco311; July 8th, 2008 at 12:02 AM.
BashGuide | BashFAQ | BashPitfalls | Guide to Forum features | Please Mark Your Threads as [SOLVED] One must imagine Sisyphus happy.
thx, this solves the problem. now how can i search for a sequence of words, like Code: man grep | grep "end options" preferably case insensitive search
man grep | grep "end options"
Code: man grep | grep -i -A 3 -- "--IgnorE-CasE"
man grep | grep -i -A 3 -- "--IgnorE-CasE"
I hope this will work: man userdel | grep '\-r'
thx guys..u rock
Ubuntu Forums Code of Conduct