RTFM like I'm 5

  • man paru | bat

What do numbers in brackets mean:
PARU(8) `paru.conf(5), mmakepkg(8),

Also, is there any way to get syntax highlighting when you do something like:
man bat | bat

Isn’t it the page number?

Some commands or other items for which there are man pages have more than one manual page, depending on what aspect of the manual you wish to consult. You bring up the pertinent page by entering ─ for example ─ the command… :arrow_down:

man 2 chmod

Now compare that to the page you get to see when you enter… :arrow_down:

man chmod

It is therefore common in UNIX parlance to refer to commands and their man pages into a single compacted description like, e.g. …

“Use chmod(2) to set the SETUID bit on an executable.”

“Add a record for the new partition to fstab(5).”

:wink:

I don’t know ─ I don’t have bat installed. What does the manual say? :stuck_out_tongue:

6 Likes

cat settings.json - no colour. | man cat =colour.


bat settings.json - colour. | man cat | bat =no colour.

I am guessing it’s because of the redirect. I suspect bat has a problem identifying the file type ─ and thus recognizing the syntax ─ when it receives input from something other than stdin. :thinking:

If you just want the manpage to be syntax-highlighted, you can use the most pager.

After installing most by yay -S most, set the env variable MANPAGER to most and the manpage should be syntax-highlighted.

$ MANPAGER=$(which most) man man
1 Like

About man

There is a man on man. :slight_smile:

===> man man

The table below shows the section numbers of the manual followed by the types of pages they contain.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

Most commands are in 1. If you are writing code, you’d be interested in 3.

The -k option will search the name and short title and display a list, with the section number.

===> man -k printf

===> man 1 printf

The parts of the man pages.

===> man man-pages

NOTE: There is tab-completion (if installed). So you can type manTabTab.

Some neat ways to format man page:

  • Create PDF doc from man: man -t bash | ps2pdf - bash.pdf
  • Create HTML doc from man: man --html=firefox bash
  • Create TEXT doc from man: man bash | col -b | nano -
  • https://wiki.archlinux.org/index.php/Color_output_in_console#less
    • Suggestion: create a new function in .bashrc called something like cman and follow arch instructions, then you can invoke man or cman. Double check your less options. A neat way to see what an environmental variables contains: declare -p ${!LE@}. Any variable that begins with “LE” will be displayed.

Man pages online (there are many more)

Other doc

  • info
  • /usr/share/doc/ directory; where SW is some software, like “bash”

I had to look up what bat was. When I first saw it, I freaked out a bit and thought about Win batch files :wink: Unless you have to use bat, I believe the standard utilities will do what you need.

7 Likes

Man pages are organized in sections referred to as numbers e.g. 8 is system management commands.

For example referring to the man page for could look like this pacman-mirrors(8)

which WM?

I’m using plasma with konsole - zsh

the setup looks cool…

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.