[SOLVED] I can know the length in lines of a man page but not of an info manual.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I can know the length in lines of a man page but not of an info manual.
I want to read the info manual of the latex program ('info latex') but I suspect it may be huge. To see the file length of the corresponding file isn't of much use, I think.
On the contrary, doing 'man cdrecord', for instance, I instantly get the number of lines.
What happens is that if I see the info manual is very large, I'll try to read some tutor or guide. But if the info were little enoough, I would gladly read it. The use I intend to to make of latex does not justify becoming an expert (only writing some little math expressions.
Suppose the name of the info file is foo.gz. Is it easy to find the relation between the number of lines (assuming say 70 chars per line) and size in bytes of foo.gz? The problem is made worse by the fact that info files contains many blank lines.
LaTeX is a complex program, I believe. I'd find a tutorial online if I were you. As to finding the length, the simplest way would be to just start reading it and if it is really long don't bother with it. But, to see the size of a file (which if it is a text file then it will equal the amount of characters as 1 char = 1 byte) use the du command. "du" stands for Disk Usage, it tells the size of a file or all the files in a folder. For example:
blah@blah:~$ du somefile.txt
blah@blah:~$ du somefolder/
blah@blah:~$ du hugefile.iso
blah@blah:~$ du -h hugefile.iso
Well. I've found a tutorial (Latex 2e in 141 minutes). As for the info file, its tree has so many levels and so many nodes within each level that it is impossible to get an appreciation of the real size once it is formatted for reading.
As for 'du' (or ls for that case), an info file is generally a compressed one, although I think it is left uncompressed somewhere on the hard disk after the first time it has been read.
As a separate matter, I'm unable to find the info, I do 'info latex' and there it is. Therefore the info file for latex should be somewhere on the hard disk. If I could know the name of the package where it belongs, then I would read the file /var/log/packages/<package-name-minus-the-extension> and look for the string 'info'. That would give me the exact location.
What I do in cases like this one, is 'grep -irl <program-name> /var/log/packages', and so I find the package name (in this case program-name is latex). But with latex this technique has failed. The output of 'grep -irl latex' is almost a screenful. However, using find, I know the exact path of latex. It ends in /bin/latex. But when I grep with this path ('grep -irl latex bin/latex') the output is
empty (grep doesn't return anything). It's a mystery. Well, good bye and thanks.
And I now have all the doc which was accessible by the command 'info latex' gathered into one and only one file. To see the number of lines, do 'less latex.info', go to the bottom of the file and read the number of lines less displays, in this case 4286. You can multiply by a factor between 0.90 and 0.95 due to the existence of the links and some LaTex commands. That's all. Regards.