Linux - Newbie This 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! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-09-2009, 05:48 PM
|
#1
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Rep:
|
I can know the length in lines of a man page but not of an info manual.
Hi:
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.
Any hint will be welcome. Thanks in advance.
|
|
|
12-09-2009, 07:21 PM
|
#2
|
Member
Registered: Jun 2009
Posts: 87
Rep:
|
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:
Code:
blah@blah:~$ du somefile.txt
34 somefile.txt
blah@blah:~$ du somefolder/
27 someotherfile.txt
9743 yetanotherfile.jpg
99999 kindabigfile.zip
blah@blah:~$ du hugefile.iso
2365943 hugefile.iso
blah@blah:~$ du -h hugefile.iso
1.9M hugefile.iso
Hope this helps!
|
|
|
12-10-2009, 01:40 AM
|
#3
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
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.
Enrique.
|
|
|
12-10-2009, 03:41 AM
|
#4
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Problem solved.
In order to have an apreciation of how much time it'll take me to read an info manual, I did this:
Let us say you type 'info latex' when you want to read the manual. The info file is '/usr/info/latex.info.gz' and it's easy to find its name and location. Now, all I have to do is
$ cp /usr/info/latex.info.gz ./
$ gzip latex.info.gz
$ ls -lh latex.info
$ blah..........blah latex.info
$
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.
|
|
|
All times are GMT -5. The time now is 09:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|