0

I am stuck currently on this question while learning Linux. Can anyone help me?

  • Try reading man man – glenn jackman Feb 21 '18 at 18:49
  • "man" displays manual pages for a command. Why not take a look at the manual for the less command, so "man less". Less is acommand that will hold the terminal open with whatever you have printed to the screen and allow you to scroll up and down. There is also the command "more". – hatterman Feb 21 '18 at 18:53
  • And there's a third one: man -P less ifconfig – see the duplicate question I linked. – dessert Feb 21 '18 at 18:58

2 Answers2

1

From man man, searching for pipe:

MAN_KEEP_FORMATTING
      Normally, when output is not being directed to a terminal  (such
      as  to a file or a pipe), formatting characters are discarded to
      make it  easier  to  read  the  result  without  special  tools.
      However,  if $MAN_KEEP_FORMATTING is set to any non-empty value,
      these formatting characters are retained.  This  may  be  useful
      for   wrappers   around   man   that  can  interpret  formatting
      characters.

It follows that man may omit formatting in man ifconfig | less, depending on environment settings. As others have noted, man ifconfig itself may not open less, also depending on environment settings (I have set it to open vim).

muru
  • 197,895
  • 55
  • 485
  • 740
0

It seems that the text of the manual page is processed slightly different. man renders some of the text bold, which is not the case if you pipe the output to less. Another visual different is that man shows a status line in the terminal.

mook765
  • 15,925