[SOLVED] how to switch man formatting to left-aligned?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
By default, man pages blocks are justified (block-aligned). Example:
Code:
WARNING
Improper use of this command may seriously
damage your system, so read this manual
carefully to understand how to use it
correctly and prevent yourself from
destroying your system.
Instead, I would like all manual pages would be displayed left-aligned, like this:
Code:
WARNING
Improper use of this command may seriously
damage your system, so read this manual
carefully to understand how to use it
correctly and prevent yourself from destroying
your system.
Is there some easy way to achieve it?
I definitely would not like to reformat all the manual pages one-by-one. but rather just changing sometnihg in some macro-definition file or something similar? .. Is it possible achieve that simply and quickly?
I have read the 'man man' carefully before posting here, also I read the 'info man', and searched for strings 'justify', 'left', 'align', but did not found anything interesting.
Your advice seems to be pretty simple. However, it does not works with my man. It does not recognize the '--nj' option:
Code:
bea:/gss # man --nj man
man: unrecognized option `--nj'
Try `man --help' or `man --usage' for more information.
bea:/gss # man -V
man 2.5.2
bea:/gss #
What version of Linux and man do you use? My setup is openSuSE 11.3 and man version 2.5.2.
Well, that's odd. Must be a relatively new option then. My version of man is up to 2.5.7. --nj is the short form of the --no-justification option.
It looks to me like openSuSE is still using a fairly old version of the coreutils. Unless there are different forks/versions of it floating around with different options.
I downloaded the debian man v2.5.7, converted it to .rpm (by "alien" perl script) and installed it.
Code:
root@bea:/tmg # rpm -ivh --force man-db-2.5.7-4.i386.rpm
Preparing... ########################################### [100%]
1:man-db ########################################### [100%]
/var/tmp/rpm-tmp.AnyEmD: line 3: /usr/share/debconf/confmodule: No such file or directory
warning: %post(man-db-2.5.7-4.i386) scriptlet failed, exit status 1
root@bea:/tmg # man -V
man 2.5.7
root@bea:/tmg #
Then I did set the option '--nj' into my .bashrc file:
Code:
export MANOPT=--nj
.. and now it works as I wanted.
Thank you for all your input.
Btw.: I think the man is not part of coreutils, but a separate project.
Btw.2: man v2.5.2 is 2.5 months old. (built at July 05th, 2010).
Nevertheless, what do you think about that error message:
/usr/share/debconf/confmodule: No such file or directory
I think, it is caused by the fact, that the package was converted from .deb format. I hope, it should not affect my system any significant way. Am I right ? .. man works .. everything else works .. Should I care of that error message ?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
A pity you already updated. I'd like to see a "-nj" not "--nj" since the shorthand notation customarily uses but one "-". Just maybe that would have worked...
Ok, my bad. I could've sworn I saw it listed in the coreutils description. Besides, it just seemed natural that it should be there.
I tried searching for a changelog also, but as I was looking for the wrong package it's understandable that I failed to find it. Now I have, and according to /usr/share/doc/man-db/changelog.gz it was first added in November of last year, along with --no-hyphenation, in between versions 2.5.6 and 2.5.7.
Speaking of which, do be careful not to confuse the build date with the release date. The SuSE package may be only a few months old, but the changelog lists version 2.5.2 as having been released in May 2008, while 2.5.7 came out in February.
Anyway, debconf is the Debian package configuration system, so yes, it's an artifact of the alien conversion. I don't think it should hurt anything, as it mostly just means the package script couldn't find the configuration tools it expected. But since it seems that all the files went to the right place and it's working properly, it's probably nothing to worry about.
@JZL240I-U: My understanding is that single-hyphen options are generally limited to single characters. Since "nj" is two characters, it still needs to use the double-hyphen long-option style.
Last edited by David the H.; 09-22-2010 at 01:42 PM.
I have tried the single dash '-nj' switch in OpenSuSE 11.3 Live CD boot (with man v2.5.2, originally contained in the OpenSuSE 11.3 distro). It does not recognize it. Nor it is mentioned in its "man man" pages. The man v2.5.2 simply cannot left-align the content.
David the H.,
Thank you for pointing out that the build date of some prog in a distro must not be the same as its release date.
Concerning building the man from source: I am not so strong in compiling, so I decided to go the simpler and quicker way (installing the ready-made package). But I will try to compile it from source.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Okay, I tried it out for myself on SuSE 11.2, didn't work either. Sorry to point you in the wrong direction . May 2008 is rather old considering, that there have been several releases since then.
Actually, I'm kind of surprised that there's still active development going on, considering how venerable the man system is. Who would've guessed that new features like this are still being added? Impressive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.